Unloading partitions in partitioned table spaces to multiple data sets
See Guidelinesto use any of these methods.
UNLOADDNPFX Prefixing – Coding SYSREC DD statements in JCL
To use numbered SYSREC DD statements, you must specify the UNLOADDN option with the UNLOADDNPFX keyword. The ddname that you specify in the UNLOADDN option is used as a prefix. For more information about UNLOADDNPFX prefixing, see UNLOADDNPFX prefixing.
In your JCL, you must code DD names using that prefix followed by a numeric suffix whose value corresponds to partition numbers to be unloaded. The numeric value may use leading zeros as long as the 8-character limit for a ddname is maintained.
You can create one DD statement for each partition. You can also use an unsuffixed ddname to receive unloaded data for any partitions missing from the list of numbered ddnames. If you do not use an unsuffixed ddname and have missing numbered ddname(s), the unload fails.
Consider the following JCL:
//SYSREC03 DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART03,…
//SYSREC05 DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART05,…
//SYSREC07 DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART07,…
//SYSREC DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.OTHER,…
Based on this JCL, BMC AMI Unload unloads partitions to the following data sets:
Partition number | ddname |
---|---|
1 | SYSREC1 |
2 | SYSREC |
3 | SYSREC3 |
4 | SYSREC |
5 | SYSREC5 |
6 | SYSREC |
7 | SYSREC7 |
With the above partitions and ddnames, partitions 2, 4, and 6 are unloaded to the SYSREC ddname.
You do not need to pad ddnames with zeros. SYSREC03 and SYSREC3 operate identically.
If you use an optional second ddname (for example, UNLOADDN (SYSREC,SYSRED) UNLOADDNPFX), then the SYSRED ddnames must correspond to the SYSREC ddnames. In this example, numbered SYSREC must have corresponding numbered SYSRED ddnames and all other partitions will use the unnumbered SYSREC and SYSRED. Consequently, if you provide a SYSRED6 ddname, UNLOADDNPFX ignores this ddname.
Partition number | SYSREC ddname | SYSRED ddname |
---|---|---|
1 | SYSREC01 | SYSRED1 |
2 | SYSREC | SYSRED |
3 | SYSREC03 | SYSRED03 |
4 | SYSREC | SYSRED |
5 | SYSREC05 | SYSRED5 |
6 | SYSREC | SYSRED |
7 | SYSREC07 | SYSRED07 |
UNLOADDNPFX partition-level output-Using the OUTPUT command
To use this method, you must specify the UNLOADDN option with the UNLOADDNPFX keyword and ensure that the DSNAME specification on the OUTPUT command contains the &PART symbolic parameter (or its equivalent, &PART1, &PART2, &PART3, &PART4, or &PART5).
BMC AMI Unload unloads each partition to its own individual data set by substituting the partition number for the indicated &PART variable (or its equivalent). If you are using a single SELECT statement to unload a partitioned object, use the outputDescriptor name specified in the UNLOADDN option as the name of the OUTPUT statement.
If you are using multiple SELECT statements, see UNLOADDNPFX Feature Combinations.
Guidelines
Whichever method you use, the following guidelines apply to unloading partitions to multiple SYSREC data sets:
- Ensure that you use only one UNLOAD command in the SYSIN stream (after any referenced OUTPUT statements).
- Place the UNLOAD command first in the SYSIN stream (after any referenced OUTPUT statements).
- Specify UNLOADDNPFX option with UNLOADDN option.
- You cannot you use UNLD syntax
- The following options must not appear on the UNLOAD command:
- BYPART
- INFILE
- EXCLUDE PART
- DIRECT NO
If you use a ddname prefix in the UNLOADDN option (with UNLOADDNPFX prefixing), the specified prefix must leave enough remaining characters to contain the largest partition number defined in a partitioned object. For example, if the specified UNLOADDN value is SYSREC (six characters), you cannot unload partitions from a table with more than 99 partitions. If you try to unload a table with more than 99 partitions, BMC AMI Unload terminates the UNLOAD command with a syntax error. Likewise, if the specified UNLOADDN value is SYSRE (five characters), you cannot unload a partitioned object with more than 999 partitions.
If you specify FILTERPART YES, BMC AMI Unload skips partitions that have been eliminated by a WHERE clause and does not initialize their DDs.
The PART and OPTIONS(PART) keywords are interchangeable.
Examples
In the following examples, assume a table space with 10 partitions and table TB1.