Unloading partitions in partitioned table spaces to multiple data sets


You can unload partitions to multiple output data sets specified by numbered SYSREC. You can specify SYSREC in JCL DD statements or OUTPUT statements. 

These output data sets have ddname suffixes that represent the partition numbers.

UNLOADDNPFX supports creating unload data sets by partition for PBG objects

You can unload these partitions using one of the following methods.

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.

Important

When multiple DD statements have equivalent numerical values, the last DD statement present in the JCL takes precedence.

In the following example, because SYSREC01 occurs last, BMC AMI Unload uses it and not SYSREC1:

//SYSREC1 DD ...
//SYSREC01 DD ...
Example

The following SYSREC DD statements and SYSIN input unload a three partition table to three data sets:

//SYSREC01 DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART01,
//            UNIT=WORK,SPACE=(CYL,(1500,20))
//SYSREC2  DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART02,
//            UNIT=WORK,SPACE=(CYL,(1500,20))
//SYSREC3  DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART03,
//            UNIT=WORK,SPACE=(CYL,(1500,20))
 .
 .
 .
//SYSIN DD *                              
UNLOAD                                                       
    UNLOADDN SYSREC UNLOADDNPFX
SELECT * FROM TB3

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:

//SYSREC01 DD DISP=(NEW,CATLG),DSN=BMC.UNLOAD.TS.PART01,…
//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

Important

If you do not follow the above guidelines, unloading partitions to multiple SYSREC data sets might not produce the expected unload data sets.

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.

Example
//SYSIN DD  *
OUTPUT UN  DSN '&USERID..P&PART'
UNLOAD UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1

This JCL generates the following UNLOAD commands:

UNLOAD PART 1 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 2 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 3 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 4 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 5 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 6 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 7 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 8 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 9 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 10 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1

Example
//UNDD DISP=...
//SYSINDD*
OUTPUT UN  DSN '&USERID..P&PART'
UNLOAD UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1

This JCL is ineligible for dynamic allocation because the DD statement takes precedence over the OUTPUT statement.

Example
//UN5   DD  DISP=(,CATLG),DSN=...
//UN06  DD  DISP=...
//UN    DD  DISP=...
//SYSIN DD  *

UNLOAD UNLOADDN UN UNLOADDNPFX PART 1:5,6:7,9:10 SELECT * FROM TB1

This JCL generates the following UNLOAD commands:

UNLOAD UNLOADDN UN5 UNLOADDNPFX PART 5 SELECT * FROM TB1
UNLOAD UNLOADDN UN06 UNLOADDNPFX PART 6 SELECT * FROM TB1
UNLOAD UNLOADDN UN UNLOADDNPFX PART 1:4,7,9,10 SELECT * FROM TB1                
Example
//SYSIN DD  *
OUTPUT UN1 DSN '&USERID..A&PART'
OUTPUT UN  DSN '&USERID..P&PART'
UNLOAD UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1

This JCL generates the following UNLOAD commands:

UNLOAD PART 1 UNLOADDN UN1 UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 2 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 3 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 4 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 5 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 6 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 7 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 8 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 9 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1
UNLOAD PART 10 UNLOADDN UN UNLOADDNPFX SELECT * FROM TB1

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*