Differences compared with the export utility
The process for exporting data with the EXPORT primary command is similar to that for the Export utility function (3.7) with the following exceptions:
- The Batch, using Db2® UNLOAD execution option is not available when exporting data using the EXPORT primary command.
- The dialog commences with the optional display of the Export Options (1 of 3) panel. The Export Utility panel is not displayed.
- The data to be exported can be the result table for the SQL statement that generated the current FM/Db2 editor session, or rows from the current FM/Db2 editor session. In the former case, the SQL statement can refer to a Db2® object (for example, when entered using the Edit function), or an arbitrary SQL statement (for example, when entered using one of the SQL options 4.1, 4.2, 4.3 or 4.4). The arbitrary SQL statement can be any valid select statement, including joins of multiple tables, sub-selects, and so on. By contrast, the Export utility only allows export of data from a Db2® object (for example, table, view, alias).
- When using the EXPORT primary command to export data from an arbitrary
SELECT statement (for example, entered using one of the FM/Db2 functions
4.1, 4.2, 4.3 or 4.4) in batch, there are some restrictions on the
template mapping operations that are supported.
It is not possible to use the template used to describe the SELECT statement in the editor session in the generated JCL deck.
For export in CSV format, which cannot be described using a template, this means any changes made to the template for the editor session are discarded when exporting the data - the output will include data for every column.
For export in other supported formats:
- Use the TE command in the editor session to select or de-select the columns as required.
- Issue the EXPORT BAT command to generate a JCL deck.
- You are required to save the output template that describes the data to be exported. This is included as a parameter in the JCL deck.
- When the JCL deck is submitted for processing, FM/Db2 re-creates a temporary template for the arbitrary SQL statement specified in the JCL deck, and then uses template mapping to identify which columns should be exported - these are the columns defined in the output template.
- The export options panel includes an input field where the number of rows to be exported can be entered. This operates independently of any input field that limits the number of rows loaded into the FM/Db2 editor session. It is therefore possible to edit a few rows of a result table using FM/Db2 edit, and then export all the rows for that result table to a data set.
Related references