You are on page 1of 20

Generation Data Group

Generation Data Group




   

GDGs are a group of data sets which are related to each other Chronologically and Functionally Useful in the Data Processing which is cyclic in nature GDG Base should be created first No more than 255 versions are allowed Must be cataloged Can reside on tapes also

GDGs (Contd.)


  

All data sets within a GDG will have same name The Generation number of a data set with in a GDG is automatically assigned by the O/S when it is created. GaaaaVnn G - Generation V - Version Generation Number G ( 0000 to 9999) Version V ( 00 to 99)

GDGs (Contd.)


Data set with in a GDG can be referenced by their relative generation number or the actual data set name, as assigned by the operating system. Generation 0 always references the current generation. Generation -1 always references the generation before the current one. Generation +1 always references the next generation after the current one.

A Conceptual Example


Lets consider an inventory information stored in a master file. This file is processed every month. Assume that the current month is July.The info is stored in the Generation Data sets. Before August Update Scenario July, Generation 0 June, Generation -1 May, Generation -2

A Conceptual Example
July would be current or 0 generation. June is -1 & May is -2 generation.  After August Update Scenario August, Generation 0 July, Generation -1 June, Generation -2 May, Generation -3  August would become the new current generation & others are updated.


Creation of An Index


Before a GDG is created, an index which defines its name along with other features must be created and catalogued. The IDCAMS facility is used to create this Index. Following subparameters on the GDG statement are used to convey information about the INDEX to the IDCAMS utility. NAME , LIMIT, NO EMPTY / EMPTY SCRATCH / NO SCRATCH

Parameters Details


NAME This is coded on the DEFINE GDG statement and is used to specify the name of the data set that is to be created. NAME (name) name ranges from 01 to 35.

Parameters Details


LIMIT The LIMIT subparameter is coded on the DEFINE GDG statement and is used to specify the total number of generations that the GDG may contain. LIMIT (number) number ranges from 01 to 255. LIMIT cannot be changed once the GDG is established.

Parameters Details


EMPTY / NOEMPTY These subparameters are mutually exclusive. EMPTY specifies that all the exiting generations if the GDG are to be uncataloged once the limit of all possible generations within the GDG has been reached. NOEMPTY specifies that only the oldest generation of the GDG is to be uncataloged if the limit is reached.

Parameters Details


SCRATCH / NOSCRATCH These subparameters are also mutually exclusive. SCRATCH if the entry of a data set in a GDG is removed from the index, then it should be physically deleted from the volume that it resides on. NOSCRATCH indicates that the entry of the data set should only be uncataloged, not physically deleted from the volume.

JCL To Create an Index




//JOB1 JOB (XHJ8PV,4CZK), 'GDG INDEX', // CLASS=T, MSGCLASS=Y, // NOTIFY=JZ4DDG //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE GDG(NAME(ZMN.GDG.TRNG) LIMIT(5) NOEMPTY SCRATCH) /*

//*

JCL For A Generation Data Set




//JOB1 JOB (XHJ8PV,4CZK), 'GDG INDEX', // CLASS=T, MSGCLASS=Y, // NOTIFY=JZ4DDG //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //FILE1 DD DSN=ZMN.GDG.TRNG(+1), // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA, // SPACE=(CYL,(2,2),RLSE), // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800) //*

Modify Features of A GDG




The features of an existing GDG can be modified via the ALTER command. Its coded on the SYSIN stmt.

Heres the Syntax. //JOB1 JOB A123, RITISH //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=A //SYSIN DD * ALTER ZMN.GDG.TRNG NOSCRATCH EMPTY /* //*

Deleting A GDG
Individual GDGs can be deleted by coding a DELETE  on the DISP parameter in the DD statement for that generation data set.  Heres the Syntax. //JOB1 JOB A123, RITISH //STEP1 EXEC PGM=IEFBR14 //SYSPRINT DD SYSOUT=A //DEL1 DD DSN =ZMN.GDG.TRNG(O), // DISP=(OLD,DELETE,DELETE) //* The Current Generation Data set is deleted for ZMN.GDG.TRNG


Deleting A GDG Index


Individual GDG Index can be deleted by using a DELETE parameter in IDCAMS Utility.  Heres the Syntax. //JOB1 JOB A123, RITISH //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=A //SYSIN DD * DELETE(ZMN.GDG.TRNG)GDG /* //* The Index of the Generation Data Group called ZMN.GDG.TRNG is deleted.


PURGE on A Delete Statement


The PURGE parameter can be coded in conjunction with the DELETE statement to delete the GDG index, even though its retention period has not expired. When a data set is created, a retention period is automatically recorded for it. When this is up, the system automatically deletes the data set from the System. The PURGE parameter can be used to override this retention period.  //JOB1 JOB A123, RITISH //STEP1 EXEC PGM=IDCAMS //SYSIN DD * DELETE(ZMN.GDG.TRNG)GDG PURGE /*


FORCE on A Delete Statement




The FORCE parameter can be coded on the DELETE statement to delete the GDG index, the model, and all related generation data sets, if they exist. //JOB1 JOB A123, RITISH //STEP1 EXEC PGM=IDCAMS //SYSIN DD * DELETE(ZMN.GDG.TRNG)GDG FORCE /* All the traces of the GDG called ZMN.GDG.TRNG will be removed from the system catalogs upon successful completion of the job.

Advantages of GDGs


Record Keeping is the responsibility of the Operating System, and not of the programmer Convenient way of relating data sets together and automatic deletions of outdated data sets

Thanks...

and looking forward to have your valuable feedback. Thanks, Sivaraman M

You might also like