Copying data to a VSAM or QSAM file
To copy data from a Db2® table
or view to a partitioned, sequential, or VSAM data set, use the Export
utility function (3.7).
Note:
- To copy data between Db2® tables, use the Copy utility function (3.3).
- To copy data to a Db2® table or view from a QSAM or VSAM data set, use the Import utility function (3.6).
- To copy data to a sequential file using the Db2® UNLOAD utility, use the Db2® Utilities option (3.9). When copying large tables, the use of the Db2® UNLOAD utility is preferable (for reasons of performance and efficiency).
The Export utility generates the export data using Db2® SQL. The data can be exported in any of these
formats:
- Db2® (File Manager internal) format. This format is not the same as the data formats used by the DSNTIAUL sample job and the Db2® utilities. This is the recommended option if the exported data is imported into another Db2® table using the FM/Db2 Import utility.
- Db2® external (or unload) format. This is the same format used by the Db2® UNLOAD utility.
- Db2® DSNTIAUL unload format. This is the format used by the Db2® DSNTIAUL sample program.
- A user defined format. Note that the user defined Placement: 3. User defined is not supported by the Import utility.
- Delimited (CSV) format. The exported data format is not supported by the Import utility.
- Copybook layout format.
- The FM/Db2 Import utility. This utility supports data in Db2® format and copybook formats.
- A PC-based spreadsheet application program in the form of a comma-delimited (CSV) file.
- Other user application programs.
If you export data, you can:
- Select the format in which the data is exported.
- Select the columns to be exported by selecting the required columns in the "from" template.
- Reformat data during export by mapping table columns to fields in the output partitioned, sequential, or VSAM data set (as defined by a template).
- Create and save a template that describes the exported data.
- Select which rows to export.
- Specify the number of rows that are exported.
- Specify whether you want to run the export in foreground or batch.
To display the Export Utility panel,
- From the Primary Option Menu panel, enter
3
(Utilities) to display the Utility Functions panel. - From the Utility Functions panel, enter
7
(Export)
Related tasks
- Copying data from a VSAM or QSAM file
- Notes on using Export
- Specifying details for the "From" table
- Specifying details for the "To" data set
Related references