Delete GDG Versions
If you need to delete your base & delete the individual data sets (G0001V00, G0002V00, etc.) and then run this IDCAM job to delete the GDG.
If you want to DELETE base, then you can use either DELETE GDG FORCE or DELETE GDG PURGE. You can give any one of these options in IDCAMS utility –
- DELETE PURGE – If you want to delete GDG Base or Index even if retention period(RETP) or expiry date is over, then you can use this option.
- DELETE FORCE – To delete the GDG index and all the generations forcefully, you can use this option.
//GDGDLTE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (XXXXX.YYYYY.ZZZZZ.GDGVER) GDG FORCE
/*
//GDGDLTE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (XXXXX.YYYYY.ZZZZZ.GDGVER) GDG PURGE
/*
If you want to delete a particular Generation of a GDG or simply delete all generations, then –
//GDGDLTE EXEC PGM=IEFBR14
//GDGDEL DD DSN=XXXXX.YYYYY.ZZZZZ.GDGVER(0),
// DISP=(OLD,DELETE,DELETE)
Delete the GDG model
//GDGMODDL EXEC PGM=IEFBR14
//GDGMODEL DD DSN=XXXXX.YYYYY.ZZZZZ.GDGMODEL,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,0),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800,DSORG=PS)
Alter the number of GDG generations
This example of a GDG was created with 15 generations of data sets using the LIMIT(15) parameter. If you wish to change the number of generations run this IDCAMS alter example where the number of generations is increased to 50. Use the name in the ALTER statement
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
ALTER XXXXX.YYYYY.ZZZZZ.GDGVER -
LIMIT(50) -
NOEMPTY –
SCRATCH
/*
OverridingGDG generations
For testing purposes or for a production incident resolution/re-run, you might need to use different datasets or GDG versions other than the ones specified in the cataloged procedure. In that case, the dataset in the procedure can be overridden in the JCL as mentioned below where we are overriding (-1) version ofXXXXX.YYYYY.ZZZZZ.DATAGDG.
//STEPXX EXEC MYPROC
//STEP1.SORTIN DD DSN=XXXXX.YYYYY.ZZZZZ.DATAGDG(-1),DISP=SHR
//*
//* STEP1 of PROC MYPROC is givenbelow
.....
.....
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=XXXXX.YYYYY.ZZZZZ.DATAGDG(0),DISP=SHR//SORTOUT DD DSN= XXXXX.YYYYY.OUTPUT(+1),
// DISP=(NEW,CATLG,DELETE),UNIT=3390,
// SPACE=(CYL,(5,1)),DCB=(LRECL=22)
//SYSOUT DD SYSOUT=*//SYSIN DD *
OMIT COND=(5,1,CH,EQ,C'M')
SORT FIELDS=(20,8,CH,A,10,3,FI,D)
SUM FIELDS=(16,4,ZD)
OPTION DYNALLOC,ZDPRINT
OUTREC FIELDS=(10,3,20,8,16,4,2Z,5,1,C' SUM')
/*
Include Omit Condition: Click Here SYNCSORT Manual: Click Here