UNLOAD TABLESPACE
You can use the UNLOAD TABLESPACE command to unload all data from the designated table space.
This option is valid only when DIRECT YES is in effect.
UNLOAD PLUS generates a SELECT statement for each table in the table space. When you specify UNLOAD TABLESPACE, you obtain the same results as if you had specified SELECT * FROM for every table in the table space. Therefore, the rules for assigning the SYSREC and SYSCNTL output data sets are the same as if you had specified SELECT * FROM for every table in the table space.
This option can help you avoid maintenance of a large list of SELECT statements. When new tables are added to the table space or deleted from it, you need not change the syntax to unload the data.
If you specify MSGLEVEL(1) on your EXEC statement or in your installation options, UNLOAD PLUS prints a cross-reference of generated SELECT statements with corresponding OBIDs. For an example of the statements that are automatically generated, see Example 18 — Unloading a table space and unloading data as Unicode.
Restrictions
The following restrictions apply to UNLOAD TABLESPACE:
- If you specify any of the following options with the UNLOAD TABLESPACE command, UNLOAD PLUS issues an error message and terminates:
- DIRECT NO, or DIRECT AUTO that results in DIRECT NO processing
- Any SELECT statement clause
- FORMAT XML when also specifying the UNICODE option
- If you specify UNLOAD TABLESPACE when unloading a LOB or XML column, UNLOAD PLUS terminates.
- If you specify UNLOAD TABLESPACE more than once in your JCL, UNLOAD PLUS terminates.
Additional considerations
The following considerations apply to the UNLOAD TABLESPACE command:
- The SELECT statements are generated in OBID order.
- If you specify INFILE ddname using a DDLIN data set to unload an image copy, each CREATE TABLE statement must specify the OBID of the table.
- If you are unloading a single-table space that never had more than one table, you do not need to specify the OBID.
- If you do not specify the name of the database, UNLOAD PLUS uses the default database name DSNDB04.
- When combining data from multiple tables into a single data set, consider using AUTOTAG YES. For details, see AUTOTAG.
CLONE
The CLONE option indicates that you want to unload only the clone table in the specified table space. (You cannot unload the clone table and base table in the same unload job.)
If you specify this option but no clone table exists in the specified table space, UNLOAD PLUS terminates.
Related topic