GDG
1. A Generation Data Group (GDG) consists of like named data sets that are chronologically or functionally related.
2. When we use GDG?
When we want to update the dataset, and the old versions are also needed.
3. Advantages
l Common name
l In chronological order
l Automatically delete
4. Relative DSN
l DSN=PAYROLL.DATA(0) -previous generation
l DSN=PAYROLL.DATA(+1) -next generation
l DSN=PAYROLL.DATA(-1) -previous of previous generation
Note: The relative generation numbers are updated after the completion of the job, not the completion of a job step.
5. Absolute DSN
e.g. PAYROLL.DATA.GxxxxVyy
xxxx-Absolute generation number
yy -Version number
Note: The version number lets you create more than one copy of a single generation. For instance, G0013V01 is the second version of a generation data set. However, only the version with the highest number is considered to be part of the GDG (that is, it’s the only one that’s assigned a relative number).
6. The syntax for the AMS DEFINE GDG command
7. Create GDG with specific model DSCB
//MM01DFG JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//MODEL DD DSNAME=MM01.PAYROLL.MASTER,DISP=(,KEEP),
// UNIT=SYSDA,VOL=SER=MPS800,SPACE=(TRK,(0)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=400)
//SYSIN DD *
DEFINE GDG ( NAME(MM01.PAYROLL.MASTER) -
LIMIT(5) -
NOEMPTY -
SCRATCH )
/*
Note: The data set name for the model DSCB should be the same as for the GDG, and the VOL parameter should specify the volume that contains the user catalog where the GDG is defined. Then, the DCB parameter defines the characteristics of each generation data set.
8. Create GDG with general-purpose model DSCB
Step1: A job that creates a general-purpose model DSCB
//MM01BR14 JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IEFBR14
//DD1 DD DSNAME=MODLDSCB,DISP=(NEW,CATLG),
// UNIT=SYSDA,VOL=SER=MPS800,
// SPACE=(TRK,(0)),
// DCB=(DSORG=PS,RECFM=FB
Step2: A job that defines a GDG with a general-purpose model DSCB
//MM01DFG JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG ( NAME(MM01.PAYROLL.MASTER) -
LIMIT(5) -
NOEMPTY -
SCRATCH )
/*
Step3: The JCL for updating a GDG that uses a general-purpose model DSCB
//MM01PY4 JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
//UPDATE EXEC PGM=PAY3200
//OLDMAST DD DSNAME=MM01.PAYROLL.MASTER(0),DISP=OLD
//NEWMAST DD DSNAME=MM01.PAYROLL.MASTER(+1),DISP=(NEW,CATLG),
// UNIT=SYSDA,VOL=SER=MPS8BV,
// SPACE=(CYL,(10,1)),
// DCB=(MODLDSCB,LRECL=400)
//PAYTRAN DD DSNAME=MM01.PAYROLL.TRANS,DISP=OLD
//PAYCORP DD SYSOUT=*
Note:
l A model DSCB doesn’t have to reside on the same volume as the GDGs that use it.
l To create a general-purpose model DSCB, you use a data set name that isn’t the same as the name of a GDG.
9. The syntax for the AMS DELETE GDG command
1. A Generation Data Group (GDG) consists of like named data sets that are chronologically or functionally related.
2. When we use GDG?
When we want to update the dataset, and the old versions are also needed.
3. Advantages
l Common name
l In chronological order
l Automatically delete
4. Relative DSN
l DSN=PAYROLL.DATA(0) -previous generation
l DSN=PAYROLL.DATA(+1) -next generation
l DSN=PAYROLL.DATA(-1) -previous of previous generation
Note: The relative generation numbers are updated after the completion of the job, not the completion of a job step.
5. Absolute DSN
e.g. PAYROLL.DATA.GxxxxVyy
xxxx-Absolute generation number
yy -Version number
Note: The version number lets you create more than one copy of a single generation. For instance, G0013V01 is the second version of a generation data set. However, only the version with the highest number is considered to be part of the GDG (that is, it’s the only one that’s assigned a relative number).
6. The syntax for the AMS DEFINE GDG command
7. Create GDG with specific model DSCB
//MM01DFG JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//MODEL DD DSNAME=MM01.PAYROLL.MASTER,DISP=(,KEEP),
// UNIT=SYSDA,VOL=SER=MPS800,SPACE=(TRK,(0)),
// DCB=(DSORG=PS,RECFM=FB,LRECL=400)
//SYSIN DD *
DEFINE GDG ( NAME(MM01.PAYROLL.MASTER) -
LIMIT(5) -
NOEMPTY -
SCRATCH )
/*
Note: The data set name for the model DSCB should be the same as for the GDG, and the VOL parameter should specify the volume that contains the user catalog where the GDG is defined. Then, the DCB parameter defines the characteristics of each generation data set.
8. Create GDG with general-purpose model DSCB
Step1: A job that creates a general-purpose model DSCB
//MM01BR14 JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IEFBR14
//DD1 DD DSNAME=MODLDSCB,DISP=(NEW,CATLG),
// UNIT=SYSDA,VOL=SER=MPS800,
// SPACE=(TRK,(0)),
// DCB=(DSORG=PS,RECFM=FB
Step2: A job that defines a GDG with a general-purpose model DSCB
//MM01DFG JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
// EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG ( NAME(MM01.PAYROLL.MASTER) -
LIMIT(5) -
NOEMPTY -
SCRATCH )
/*
Step3: The JCL for updating a GDG that uses a general-purpose model DSCB
//MM01PY4 JOB (36512),'R MENENDEZ',NOTIFY=&SYSUID
//UPDATE EXEC PGM=PAY3200
//OLDMAST DD DSNAME=MM01.PAYROLL.MASTER(0),DISP=OLD
//NEWMAST DD DSNAME=MM01.PAYROLL.MASTER(+1),DISP=(NEW,CATLG),
// UNIT=SYSDA,VOL=SER=MPS8BV,
// SPACE=(CYL,(10,1)),
// DCB=(MODLDSCB,LRECL=400)
//PAYTRAN DD DSNAME=MM01.PAYROLL.TRANS,DISP=OLD
//PAYCORP DD SYSOUT=*
Note:
l A model DSCB doesn’t have to reside on the same volume as the GDGs that use it.
l To create a general-purpose model DSCB, you use a data set name that isn’t the same as the name of a GDG.
9. The syntax for the AMS DELETE GDG command