Friday, 26 July 2013

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

Welcome to another exciting JCL tutorial on "Generation Data Group or GDG". In today's tutorial, I'll discuss important mainframe terminology, it is basically used for maintaining data backups and is known as Generation Data Group (GDG). In this GDG tutorial, I'll explain the various aspect of the Generation data group (GDG) in Mainframe. 

Also, I showcase a couple of examples 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.

Generation Data Group

What is a 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 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:


Generation Data Group Process Flow.

Generation Data Group
Every time a generation data set is processed by a job, a new generation of the data set is added to the GDG. This new GDG version becomes the current generation, and the old current generation becomes the previous generation. If necessary, the previous generation can be processed. Normally, though, the current generation is processed the next time the job is run

In order to refer to the generations of a GDG base, you can use relative generation numbers. Following are the relative generation 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, the Z/OS operating system 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

Although z/OS 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 members refer to JCL.


Example: How to create a Generation Data Group.

//               MSGLEVEL=(1,1),
//               NOTIFY=&SYSUID
//*             Generation Data Group Usage in JCL  
//              DISP=(NEW,CATLG,DEL),
//              UNIT=SYSDA,
//              SPACE=(CYL,(10,1))

In the above example RC01.ENROLL.MSTR(0) is the previous month's payroll file and RC01.PAYROLL.MSTR(+1) is a new incremental file create after the 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.
Topictrick: Generation Data Group (GDG). 

No comments:

Post a comment