Notes on using Export

The Export utility function provides one method for moving Db2® data between different Db2® sub-systems (that is, to export data from one Db2® sub-system and import it to another Db2® sub-system). If you want to move data between tables in the same Db2® sub-system, you might find it more convenient to use Copy (3.3), or move the data by direct execution of SQL statements.

In general terms, the Export utility function is suitable for extracting small to medium volumes of data from Db2® tables. It is not intended to serve as a substitute for the Db2® utilities if unloading or migrating large volumes of data. The Db2® utilities offer superior performance in these situations.

It is recommended that you run the Export utility in batch whenever possible.

The Export utility provides for automatic mapping of the Db2® null indicator. However, if Export Option Data format 4. User defined Null Indicators Placement 3. User defined is selected the template editor shows the null indicator as a separate item in the “From” template on the Field Mapping panel. It is therefore possible to re-map the null indicator associated with nullable columns to a field in the export data set. If you want to rearrange the data fields in the export data set, it is recommended that you first export the data using the default mapping and then use File Manager (base) to map the data to the required format.

A sample REXX exec is provided in SFMNSAM1 that converts a FM/Db2 template generated by FM/Db2 into a COBOL or PL/I copybook.

To convert a FM/Db2 template generated by FM/Db2 into a COBOL or PL/I copybook, you specify a TSO command like the following:
FMN2CPYB input output language
where:
input
The name of a sequential file or partitioned data set and member that contains a File Manager Db2® template.
output
The name of a sequential file or partitioned data set and member that will contain the copybook.
language
Optional keyword that determines the type of copybook generated. Valid values are:
  • COBOL
  • PL/I
If not specified, a COBOL copybook is generated.

The sample REXX must be copied to a library in your SYSPROC or SYSEXEC concatenation. Alternatively, you can specify the library name containing the sample exec in the command.

Related tasks