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 ----------------------------------------+
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 ----------------------------------------+
>>-- 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 -------------------------+
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:
|
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.
|
WIDTH |
|
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:
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
EXPORT QUERY rsbi:/.workspaces/Default/Cloudant_query TO
C:\Users\Username\Desktop\Cloudant_query.clq