Generation Data group
From Wikipedia, the free encyclopedia
On an IBM mainframe computer a Generation Data Group (GDG) is a group of chronologically or functionally related datasets. GDGs are processed periodically, often by adding a new generation, retaining previous generations, and sometimes discarding the oldest generation.
A GDG base is created in the system catalog and keeps track of the generation numbers used for datasets in the group. The VSAM utility — IDCAMS — is used to define the GDG base.
DEFINE GENERATIONDATAGROUP - (NAME(GDG.BASE) - LIMIT(10) NOEMPTY SCRATCH - OWNER(USERID) - )
GDG has three parts:
- Index
- Model
- Generation
A sample program:
//SSS007TR JOB (20,FB3),'ANUJ',MSGLEVEL=(1,1), // CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID //STEP1 EXEC PGM=IDCAMS //SYSIN DD * DEFINE GDG (NAME(SSS007.TEST.GDG9) - LIMIT (5) - SCRATCH - NOEMPTY) /* //SYSPRINT DD SYSOUT=* //STEP2 EXEC PGM=IEFBR14 //FILE1 DD DSN=SSS007.TEST.GDG91,DISP=(,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=80) //STEP3 EXEC PGM=IEFBR14 //FILE1 DD DSN=SSS007.TEST.GDG9(+1),DISP=(,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE), // DCB=SSS007.TEST.GDG91 // //STEP4 EXEC PGM=IDCAMS //SYSIN DD * DELETE (SSS007.TEST.GDG9) GDG PURGE FORCE /* //