Using a GDG to generate unique output data set names

The user can also define a GDG for each dump job and specify the generation data sets (GDS) as the output dump data set name. The GDG must specify scratch and 255 as the maximum number of data sets.

The sample JCL below shows a how to define a GDG:
Figure 1. Sample JCL to define a GDG

//JOB11     JOB MSGCLASS=X,CLASS=A,MSGLEVEL=(1,1),REGION=0M
//STEP1    EXEC   PGM=IDCAMS
//GDGMOD   DD     DSNAME=GDG01,DISP=(,KEEP),
//         SPACE=(TRK,(0)),UNIT=DISK,VOL=SER=VSER03,
//         DCB=(RECFM=FB,BLKSIZE=7892,LRECL=100)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD     *
DEFINE GENERATIONDATAGROUP -
       (NAME(GDG01) -
        EMPTY -
        SCRATCH -
        LIMIT(255) )
/*

The sample JCL below shows a sample of how to create a GDG entry:
Figure 2. Sample JCL to use the GDG

//JOB12     JOB MSGCLASS=X,CLASS=A,MSGLEVEL=(1,1),REGION=0M
//DSS      EXEC  PGM=ADRDSSU
//GDGDD1   DD DSNAME=GDG01+1),DISP=(NEW,CATLG),
//         UNIT=3480,VOL=SER=TAPE04,
//         LABEL=(1,SL)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD    *
      DUMP OUTDD(GDGDD1) -
      DS(INCL(USER1.DATASET1)) -
      CICSVRBACKUP
/*

Note: CICS® VR does not support more than 255 GDS data sets for a GDG because non-SMS GDG data sets beyond the 255th data set are not cataloged. CICS VR requires that all associated data sets be cataloged.