Friday, 26 July 2013

Master Generation Data Group In Just A Few Minutes! | Generation Data Group.

In today's tutorial I'll discuss about another important terminology, it is basically used for maintaining data backups and is known as Generation Data Group (GDG). In this tutorial, I'll explain the various aspect Generation data group in Mainframe. 

Also, I would show couple of example of defining a generation data group, delete generation data group, alter generation data group, generation data group limit etc. So, let's begin with our tutorial.

GDG
Generation Data Group

What is generation data group?


Generation Data Group, or GDG, is a collection of two or more chronologically related versions of the same data set (i.e. flat file). Each version is called a generation data set. 

Generation Data Sets are non-VSAM sequential data sets that reside on tape or DASD.


GDG, Generation Number Format - GaaaaVnn
     * aaaa value lie between 0000 to 9999
     * nn value lie between 00 to 99

Generation Data Group Example:


'RC01.EMPROLL.MSTR.G0001V00'
'RC01.EMPROLL.MSTR.G0002V00'
'RC01.EMPROLL.MSTR.G0003V00'


Generation Data Group Process Flow.
GDG
Generation Data Group
                               
Each time a generation data set is processed, a new generation of the data set is added to the GDG. This new version becomes the current generation, and the old current generation becomes the previous generation.


If necessary, a previous generation can be processed. Normally, though, the current generation is processed the next time the job is run

To refer to the generations of a GDG, you can use relative generation numbers. When using these numbers: 

    • 0 refers to the current generation.
    • -1-2, and -3 refer to the three previous generations. 
    • +1 refers to the next generation.

The Generation Data Group and each generation data set in it must be cataloged. Then, OS/390 uses the GDG’s catalog entry to keep track of the relative generation numbers.


When you create the catalog entry for a Generation Data Group, you specify how many generations should be maintained. Then, after each processing cycle, the oldest generation is removed from the group.

Relative name
Data set name before processing
Data set name after processing
EMPMAST(0)
EMPMAST.G0012V00
EMPMAST.G0013V00
EMPMAST(-1)
EMPMAST.G0011V00
EMPMAST.G0012V00
EMPMAST(-2)
EMPMAST.G0010V00
EMPMAST.G0011V00
EMPMAST(-3)
EMPMAST.G0009V00
EMPMAST.G0010V00

Although OS/390 lets you use relative generation numbers in your JCL, it uses absolute generation numbers to identify each generation on the system itself. These numbers are added to the data set names as shown in below fig. As you can see, each absolute generation number consists of a generation number like G0013 followed by a version number like V00.

The absolute generation number consists of four digits for the generation number and two digits for the version number as shown above. Because these numbers require 9 characters (including the preceding period), the data set name of a generation data group is limited to 35 characters (not 44).

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 Generation Data Group (that is, it’s the only one that’s assigned a relative number).

Generation Data Group member refer in JCL.

dsname(relative-number)  

Create Generation Data Group Example.

//RC01TC1  JOB  (99932),'RC MAINFRAME',MSGCLASS=X,
//               MSGLEVEL=(1,1),
//               NOTIFY=&SYSUID
//********************************************************** 
//*             Generation Data Group Usage in JCL  
//**********************************************************
//GDGPGM   EXEC PGM=EMPSAL
//PRVEMPF  DD   DSNAME=RC01.EMPROLL.MSTR(0),DISP=(OLD)
//NEWEMPF  DD   DSNAME=RC01.PAYROLL.MSTR(+1),
//              DISP=(NEW,CATLG,DEL),
//              UNIT=SYSDA,VOL=SER=DSS98V,
//              SPACE=(CYL,(10,1))
//

In above example RC01.EMPROLL.MSTR(0) is previous month payroll file and RC01.PAYROLL.MSTR(+1) is new incremental file create after current month processing. 

Generation data group usage rule. 

  • Relative generation numbers are updated after the completion of the job, not the completion of a job step. As a result, any step that refers to a generation created in a preceding step must refer to it in relation to the generation that was current when the job began.

No comments:

Post a Comment