Thursday, July 14, 2011

GDG



GDG -  Generation Data Group
GDG is group of datasets that are related to each other chronologically or functionally. Each of these dataset is called a generation. These related dataset share a unique Dataset Name. Every GDG data set has a Generation number and Version number assigned to each data set.
Generation number can be represented by GaaaaVnn aaaa is between 0000 to 9999 nn is between 00 to 99 In JCL
For example
AALIB.LIB.TEST.G0001V00
AALIB.LIB.TEST.G0002V00
AALIB.LIB.TEST.G0003V00

What is the main purpose of GDG and where we can use
  • To maintain all generation of data sets  without any complex way; if we want to see all the transactions have done till today; we can use GDG base to retrieve all generation.
  • To delete / uncatalog older generation
  • To refer current and older versions of data sets Very easily
  •  No need of change the JCL every time before submitting
            Mostly in production environment, for every month we want to take report of certain process; in this case we will use GDG. For example:-  if we want to take the report of all the accounts in monthly basis means, we can use GDG to create the monthly report.
We can create the dataset as mentioned below:
            January - MYLIB.LIB.ACC.JAN
            February - MYLIB.LIB.ACC.FEB
            March  - MYLIB.LIB.ACC.MAR and so on..
So this will avoid the problem of every month we need to go and change the name of the dateset in JCL.

GDG Generation
GDG can be created by IDCAMS utility
GDG model can be created by IEFBR14
We can use IEFBR14  for delete the GDG version alo
GDG definition can be altered by IDCAMS
Refer current version with 0 ( Ex. MYLIB.LIB.ACC(0) ) new version going to create with +1 ( Ex. MYLIB.LIB.ACC(+1) ) older versions , refer with -1 -2 -3 etc.... ( Ex. MYLIB.LIB.ACC(-1) )
All new generation dataset should have DISP parameter as “DISP=(NEW,CATLG,DELETE)”