//TEST JOB 5675,'DEPT. 25'
//STEP1 EXEC PGM=A1
//D1 DD DSNAME=A01DD1,DISP=(,PASS),UNIT=3390,
// SPACE=(TRK,1),VOLUME=SER=333001
//STEP2 EXEC PGM=A2
//D2 DD DSNAME=LIB1,DISP=OLD,UNIT=3390,
// VOLUME=(PRIVATE,SER=123456)
//D3 DD DSNAME=ABC,DISP=(OLD,KEEP),UNIT=AFF=D2,
// VOLUME=SER=777777
//D4 DD DSNAME=TAPE,DISP=OLD,UNIT=(3420-5,P,DEFER),
// VOLUME=SER=(342001,342002,342003,342004,342005)
//D5 DD DSNAME=DISK,DISP=(SHR,KEEP),UNIT=(,P),
// VOLUME=SER=(333005,333008,333010)
//D6 DD UNIT=3390,VOLUME=REF=*.D2,SPACE=(TRK,(5,2))
//D7 DD UNIT=3390,VOLUME=REF=DISK,SPACE=(TRK,(10,5))
//STEPA EXEC PGM=TESTA
//A1 DD UNIT=3400-5,VOLUME=SER=111111
//A2 DD UNIT=AFF=A1,VOLUME=SER=222222
The system assigns one unit for both volumes. Volume 111111 is mounted first; 222222 is mounted when A2 is opened. This processing is the same for both tape and direct access.
//STEPB EXEC PGM=TESTB
//B1 DD UNIT=(3330,2),VOLUME=SER=(A,B)
//B2 DD UNIT=AFF=B1,VOLUME=SER=(C,D)
The system allocates two units to B1; volumes A and B are mounted. B2 gets allocated to the same two units; volumes C and D are mounted when the data set for B2 is opened.
//STEPC EXEC PGM=TESTC
//C1 DD UNIT=(3330,2),VOLUME=SER=(A,B)
//C2 DD UNIT=AFF=C1,VOLUME=SER=(C,D)
//C3 DD UNIT=SYSDA,VOLUME=SER=B
STEPC shows a direct access example of volume affinity for volume B. The system allocates volumes A and C to share one unit and volumes B and D to two other units.
//STEPD EXEC PGM=TESTD
//D1 DD UNIT=(3330,2),VOLUME=SER=(E,F)
//D2 DD UNIT=AFF=D1,VOLUME=SER=(G,H)
STEPD is a direct access example. If volume E is currently mounted and is permanently resident or reserved, the system allocates a separate unit for volume E because it cannot be dismounted. The system allocates one unit for volume G and a second unit to be shared by volumes F and H. Therefore, three volumes are used, instead of two, because of the permanently resident or reserved attributes.
//STEPE EXEC PGM=TESTE
//E1 DD UNIT=3400-5,VOLUME=SER=(111111,222222)
//E2 DD UNIT=AFF=E1,VOLUME=SER=(222222)
STEPE is a tape example. The system allocates two units: one for volume 111111 and the second for volume 222222. Note that only one data set can be open on a tape volume at a time; to prevent an error when the data set for E2 is opened, the data set for E1 must be closed before E2 is opened.
//STEPF EXEC PGM=TESTF
//F1 DD UNIT=SYSDA,VOLUME=SER=(ABCDEF,GHIJKL)
//F2 DD UNIT=AFF=F1,VOLUME=SER=(ABCDEF)
STEPF is a direct access example. The system ignores the volume affinity between F1 and F2. Volume ABCDEF of both DD statements uses one unit while the other volume, GHIJKL, uses a different unit.
//STEPG EXEC PGM=TESTG
//G1 DD UNIT=3400-5,VOLUME=SER=111111
//G2 DD UNIT=AFF=G1,VOLUME=SER=111111
//G3 DD UNIT=AFF=G1,VOLUME=SER=222222
In STEPG, G2 and G3 request unit affinity to G1. The system allocates one unit to be used for volume 111111 and volume 222222.
//STEPH EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=INPUT.DATASET,DISP=SHR
//SYSUT2 DD DSN=OUTPUT.DATASET,DISP=(NEW,KEEP),LABEL=(1,SL),
// STORCLAS=LIBRARY,DATACLAS=PITTBRGH
STEPH copies an input data set to a new output data set on a system-managed tape volume to be shipped offsite to Pittsburgh. The output data set is directed to a system-managed tape library because of the storage class "LIBRARY".
Data class "PITTBRGH" defines the media type and recording format requirements of the Pittsburgh data center. If either the media type or the recording-format requirements of that center changes, the storage administrator modifies the "PITTBRGH" data class definition but does not have to modify JCL.
//STEPI EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=INPUT.PAYROLL,DISP=SHR
//SYSUT2 DD DSN=OUTPUT.PAYROLL,DISP=(NEW,KEEP),LABEL=(1,SL),
// DATACLAS=PAYROLL
STEPI copies an input payroll data set to a data set on a system-managed tape volume. The installation's ACS routines must assign a storage class to DD SYSUT2 that directs the allocation to a system-managed tape library. The data class "PAYROLL" defines the media and record format required for payroll data. If either the media type or recording format requirements for payroll data changes, the storage administrator modifies the "PAYROLL" data class definition but does not have to modify JCL.
//STEPJ EXEC PGM=IEBCOPY
//ICOPY001 DD DISP=SHR,DSN=DASD.DS1
//OCOPY001 DD UNIT=(3490,,DEFER),DISP=(,KEEP),
// DSN=USERID.TEST1.ATL,VOL=(,RETAIN)
//ICOPY002 DD DISP=SHR,DSN=DASD.DS2
//OCOPY002 DD UNIT=AFF=OCOPY001,DISP=(,KEEP),LABEL=2,
// DSN=USERID.TEST2.ATL,VOL=(,RETAIN,REF=*.OCOPY001)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY OUTDD=OCOPY001,INDD=ICOPY001
COPY OUTDD=OCOPY002,INDD=ICOPY002
/*
This example shows data set stacking using VOL=REF. STEPJ stacks copies of DASD data sets represented by ICOPY001 and ICOPY002 onto an output system-managed tape volume defined by statements OCOPY001 and OCOPY002. Because these data sets will be opened serially, only one system-managed tape library device needs to be allocated.
The installation's ACS routines must assign a storage class that directs the allocation of DD OCOPY001 to a system-managed tape library (OCOPY002 assumes the library status of OCOPY001 by its volume reference). Because OCOPY002 specifies unit affinity to DD OCOPY001, the system allocates only one system-managed tape library device for these two DD statements.
For more information about data set stacking, see Stacking data sets.
//STEPK EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DSN=INPUT.18TRACK.LIBRARY.DATASET,DISP=SHR,LABEL=(,,,IN)
//SYSUT2 DD DSN=OUTPUT.DATASET,DISP=(NEW,PASS),LABEL=(1,SL),
// STORCLAS=LIBRARY,DATACLAS=PITTBRGH
STEPK copies existing data set INPUT.18TRACK.LIBRARY.DATASET to new data set OUTPUT.DATASET. Because the existing data set was recorded on an 18-track format device, and will not be extended during the allocation of DD SYSUT1, the system can use any device that can read an 18-track formatted volume for the allocation.
If the IBM 3495 Tape Library Dataserver contains both 3480X devices (18-track read/write) and 3490 devices (18-track and 36-track read, 36-track write), using LABEL=(,,,IN) to allocate SYSUT1 means that either device can be allocated.