Module 7: JCL GDG
Concatenating generations of a GDG
//DEPTJOB JOB A123,’STEVE’
//STEPNAME EXEC PGM=IDCAMS
//SYSPRINT DD *
//SYSUT1 DD DSN=PAYROLL.SALARY.MONTHLY, <--Concatenated generations
//SYSUT2 DD DSN=PAYROLL.SALARY.PSBKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=PROD,SPACE=(CYL(2,2),RLSE),
// DCB=(LRECL=80,RECFM=FB,
// BLKSIZE=0,DSORG=PS)
//SYSIN DD *
REPRO INFILE(SYSUT1) OUTFILE(SYSUT2)
/*
//
As shown above, when we have to use generation data sets associated with group as a single, contiguous file, we can specify GDG index name without brackets ().
Thus, In above case data from all generations of GDG “PAYROLL.SALARY.MONTHLY” will be copied sequential file ‘PAYROLL.SALARY.PSBKUP’