EXPORT command

The EXPORT command saves objects that are stored in a database or are currently in an open window to a file.

Syntax

To export an object from a database to a file:

>>-- EXPORT --- QUERY --- ObjectName TO FileName -------------------------<<
             +- PROC --+                       ( +- CONFIRM = YES/NO -+
                                                 +- SAVEATSERVER = YES/NO -+
>>-- EXPORT FORM ObjectName TO FileName ----------------------------------<<
                                        ( +-  CONFIRM = YES/NO            -+
                                          +-  LANGUAGE = ENGLISH/SESSION  -+
                                          +-  SAVEATSERVER = YES/NO -------+
>>-- EXPORT TABLE ObjectName TO FileName -------------------------------------------------<<
                                     ( +- CONFIRM = YES/NO ---------------------------------------------+
                                       +- DATAFORMAT = CSV/DBF/HTML/IXF/PDF/SHP/TEXT/WQML/XLS/XLSX/XML -+
                                       +- DATEFORMAT = Java date format string -------------------------+
                                       +- TIMEFORMAT = Java time format string -------------------------+
                                       +- OUTPUTMODE = BINARY/CHARACTER/PC -----------------------------+
                                       +- LOBSINFILE = YES/NO ------------------------------------------+
                                       +- LOBSTO = path1;path2;... -------------------------------------+
                                       +- LOBFILE = basefile1;basefile2;... ----------------------------+
                                       +- CCSID = integer or Java encoding name ------------------------+
                                       +- COLUMNHEADINGS = YES/NO --------------------------------------+
                                       +- UNICODE = YES/NO ---------------------------------------------+
                                       +- SAVEATSERVER = YES/NO ----------------------------------------+
Note: EXPORT TABLE always exports names.
Restriction: LOBSINFILE, LOBSTO, and LOBFILE parameters are available only for the IXF data format.

To export an Analytics object from the QMF Catalog when you work with Db2 for z/OS database:

>>-- EXPORT --- ANALYTICS --- ObjectName TO FileName ------------------------<<
                                               ( +- CONFIRM = YES/NO -----+
                                                 +- DATAFORMAT = PNG/PDF -+
                                                 +- HEIGHT ---------------+
                                                 +- SAVEATSERVER----------+
                                                 +- WIDTH ----------------+

To export an object currently in an open window to a file:

>>-- EXPORT --- QUERY --- TO FileName ---------------------------------<<
             +- PROC --+              ( +- CONFIRM = YES/NO -+
                                        +- SAVEATSERVER = YES/NO -+
>>-- EXPORT FORM TO FileName ------------------------------------------<<
                             ( +- CONFIRM = YES/NO -----------+
                               +- LANGUAGE = ENGLISH/SESSION -+
                               +- SAVEATSERVER = YES/NO ------+
>>-- EXPORT DATA TO FileName ----------------------------------------------------<<
                        ( +- CONFIRM = YES/NO ---------------------------------------------+
                          +- DATAFORMAT = CSV/DBF/HTML/IXF/PDF/SHP/TEXT/WQML/XLS/XLSX/XML -+
                          +- DATEFORMAT = Java date format string--------------------------+
                          +- TIMEFORMAT = Java time format string--------------------------+
                          +- OUTPUTMODE = BINARY/CHARACTER/PC -----------------------------+
                          +- LOBSINFILE = YES/NO ------------------------------------------+
                          +- LOBSTO = path1;path2;... -------------------------------------+
                          +- LOBFILE = basefile1;basefile2;... ----------------------------+
                          +- CCSID = integer or Java encoding name ------------------------+
                          +- COLUMNHEADINGS = YES/NO --------------------------------------+
                          +- UNICODE = YES/NO ---------------------------------------------+
                          +- MODE = GRID/RAW ----------------------------------------------+ 
                          +- SAVEATSERVER = YES/NO ----------------------------------------+
Restriction: LOBSINFILE, LOBSTO, and LOBFILE parameters are available only for the IXF data format.
>>-- EXPORT REPORT TO FileName --------------------------------------------------<<
                               ( +- CONFIRM = YES/NO ------------------------------+
                                 +- DATAFORMAT = TEXT/HTML/PDF --------------------+
                                 +- SPLIT = YES/NO --------------------------------+
                                 +- ORDER = 0/1/2 ---------------------------------+
                                 +- WIDTH = integer -------------------------------+
                                 +- LENGTH = integer ------------------------------+
                                 +- UNITS = INCHES/CENTIMETERS/MILLIMETERS/POINTS--+
                                 +- USEFORMPS = YES/NO ----------------------------+
                                 +- SEPARATOR = any HTML text ---------------------+
                                 +- CCSID = integer or Java encoding name ---------+
                                 +- SAVEATSERVER = YES/NO -------------------------+
Note: If several reports of different types are open in the editor area, the EXPORT REPORT command exports visual reports first.
Parameter Description
ObjectName The name of the object to export from the database.
Note: For Cloudant queries, specify the full object key.
FileName The name of the previously created file to which the object will be exported or a temporary directory C:\Temp.
CONFIRM Specifies whether or not to display a confirmation dialog before replacing an existing file. If CONFIRM is not specified or is NO, the corresponding resource limit is used.
LANGUAGE Specifies whether a form is exported in English or in the current session language. A form that is exported in English can be run in any NLS session. A form exported in the session language can only be run in a session of the same language. The default value is provided by the DSQEC_FORM_LANG global variable.
DATAFORMAT Specifies the file format of the exported data. If you omit this parameter, the DSQQW_EXP_DT_FRMT global variable supplies the format to be used. You can specify in the DSQQW_EXP_DT_FRMT global variable:
  • zero (0) for text format
  • two (2) for HTML format
  • three (3) for CSV format
    Note: The separator is always a comma unless the locale uses decimal comma. In this case, a separator of semi-colon is used.
  • four (4) for IXF
  • five (5) for dbase III files
  • six (6) for Shapefile format
  • seven (7) for WQML format
  • eight (8) for XML format
  • nine (9) for PDF format
  • ten (10) for XLS format
  • eleven (11) for XLSX format
If you specify IXF, the DSQQW_EXP_OUT_MDE global variable can be set to either zero (0) for character mode System/370 IXF or one (1) for PC/IXF. When exporting reports, HTML format adds the <PRE> tag, TEXT is for a text-based file, and PDF is for a PDF-based file.
DATEFORMAT Specifies how the date is formatted in the HTML, CSV or TXT export file.

Date formats are specified by Java date pattern strings. Within date pattern strings, unquoted letters from 'A' to 'Z' and from 'a' to 'z' are interpreted as pattern letters representing the components of a date string.

Text can be quoted using single quotes (') to avoid interpretation.

Note: If the format string includes spaces, enclose it in quotes. For more information about Java format strings, see the Java 2 SDK, Standard Edition Documentation.
TIMEFORMAT Specifies how the time is formatted in the HTML, CSV or TXT export file.

Time formats are specified by Java time pattern strings. Within time pattern strings, unquoted letters from 'A' to 'Z' and from 'a' to 'z' are interpreted as pattern letters representing the components of a time string.

Text can be quoted using single quotes (') to avoid interpretation.

Note: If the format string includes spaces, enclose it in quotes. For more information about Java format strings, see the Java 2 SDK, Standard Edition Documentation.
OUTPUTMODE Specifies the output format of the data.
LOBSINFILE Specifies whether or not LOBs are included in the exported data.
LOBSTO The location to save the LOBs.
LOBFILE The base name of the exported LOBs.
CCSID Specifies the code page (coded character set identification number) to use when saving the file. This value can either be an integer or the Java™ encoding name of the code page. All of the Java encoding names that are listed in the Export dialog are supported. Any encoding names that are supported by your JVM can be used as well.
COLUMNHEADINGS Specifies whether or not to export column headers. It is only available for export to HTML, CSV or TEXT files.
UNICODE Specifies whether graphic columns will be saved as UNICODE. This option is only applicable when saving data in IXF format.
SPLIT Specifies whether the report will be split into pages. Use only when exporting visual reports.
ORDER Controls how the report will be split into pages. Use only when exporting visual reports.
  • 0 - each visual report page will be exported into separate files.
  • 1 - a single output file contains visual report pages in "across then down" order.
  • 2 - a single output file contains visual report pages in "down then across" order.
WIDTH
  • Specifies the width in units for a report page.
    Note: Used for the both classic and visual reports.
  • Specifies the width of an exported Analytics object in pixels.
LENGTH Specifies the length in units for a report page.
Note: Used for the both classic and visual reports.
UNITS Specifies the measurement units that are used in the WIDTH and LENGTH parameters.
Note: Use only when exporting visual reports.
USEFORMPS Specifies whether or not to use the Windows form associated with the object.
SEPARATOR Specifies a string that will be used as a page separator. Use quotes if necessary.
Note: Use only when exporting visual reports.
MODE Specifies whether the query result data is saved with formatting and added calculated columns. You can specify one of the following values:
  • GRID to specify that all of the data as it is currently formatted in the current query results will be saved. Any calculated columns that have been added to the query results are included.

    This is the default value for the PDF, XLS, and XLSX formats.

    Note: MODE GRID exports labels if DSQDC_COL_LABELS is set to 1. MODE GRID exports names if DSQDC_COL_LABELS is set to 0.
  • RAW to specify that all of the data in the current query results will be saved. Any formatting that has been applied to the data will not be saved. Any calculated columns that have been added to the query results will not be saved.

    This is the default value for all formats other than PDF, XLS, and XLSX.

    Note: MODE RAW always exports names. This also applies when the MODE parameter is omitted.
Note: The parameter is ignored if DATAFORMAT=XLS, XLSX.
SAVEATSERVER Specifies whether or not to include the Root output directory in the export path of an object. This directory is set on Server-Side File System page of the Preferences window. In QMF for WebSphere® you can specify only the path, lying in the root directory set by administrator. Otherwise, the export will be forbidden and an error will occur.
HEIGHT Specifies the height of an exported Analytics object in pixels.

Example

The following example exports a query from the QMF Catalog to the previously created directory:
EXPORT QUERY USER1.QUERY TO C:\Queries\query1.vry

The following is an example of using DATEFORMAT and TIMEFORMAT parameters:

EXPORT DATA TO C:\Results\example.txt (DATEFORMAT="yyyy MM dd", TIMEFORMAT=HH:mm
EXPORT TABLE Q.INTERVIEW TO "C:\Tables\interview.txt" (DATEFORMAT=yyyy/MM/dd,
TIMEFORMAT="HH mm"

The following is an example of using SAVEATSERVER parameter. Consider the case when the root output parameter is set to C:\Temp on the Server-Side File System preferences page:

EXPORT QUERY USER1.QUERY TO query1.vry (SAVEATSERVER=YES

The result of the command will be a new file in C:\Temp\query1.vry

The following example exports a Cloudant query that is stored in a repository to a file:
EXPORT QUERY rsbi:/.workspaces/Default/Cloudant_query TO
C:\Users\Username\Desktop\Cloudant_query.clq