Module 7: JCL GDG
Creation of GDG base
- GDG base can be created using IEHPROGM (explained in JCL utilities module) or using IDCAMS utility. Nowadays, IDCAMS is preferred utility for creating GDG base
- Below is an sample JCL creating GDG base using IDCAMS
//DEPTJOB JOB A123,’STEVE’ //STEPNAME EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE GDG(NAME(PAYROLL.SALARY.MONTHLY) – LIMIT(10) - NOEMPTY - SCRATCH) /* //
- DEFINE GDG statement is used to create GDG base. The parameters can be given while creating a GDG are:-
- NAME: - GDG name can be max 35 characters long. Since the GaaaaVxx take up to 9 positions we have to keep the name limited to 35 chars or less.
- LIMIT: - Maximum number of generations can exist at any point of time. Number can range from 1 to 255.
Note: - NAME and LIMIT are mandatory parameters
- EMPTY/NOEMPTY: - You can specify either of them.
When LIMIT specified is reached:-
- EMPTY removes(uncatalogs) all existing generations
- NOEMPTY removes(uncatalogs) only the oldest generation of GDG
- SCRATCH/NOSCRATCH: - You can specify either of them.
- SCRATCH uncatalogs and deletes the generations that are not kept
- NOSCRATCH just uncatalogs and does not physically delete the generation from disk
- OWNER :- Used to specify owner of the GDG
- FOR DAYS(n) / TO (DATE) :- Used to specify the retention period using FOR DAYS(N) or to specify expiration date using TO(DATE)