Monday, 29 July 2013

Enhance Your Create GDG, Create GDG Base, Generation Data Group Skills During Your Lunch Break!

In today's tutorial, I will talk about various operations that can be performed with Generation Data Group. I would primarily cover three basic operations i.e. defining a generation data group, altering a generation data group and deleting a generation data group. So, finally let's start with tutorial.

Create Generation Data Group

Generation Data Group Overview.

  1. To define a Generation Data Group (GDG), you must create a catalog entry for the GDG, and create a model data set control block on the same volume as the catalog entry for the GDG.
  2. To create a GDG catalog entry, you invoke the VSAM utility program, AMS, and issue a DEFINE GDG command.

DEFINE Generation Data Group Syntax.

      ( NAME(entry-name)
      [ EMPTY | NOEMPTY ]
      [ OWNER(owner-id) ]
      [ TO(yyyyddd) | FOR(nnnn) ] )

Name Specifies the name of the generation data group. This name follows normal data set naming conventions but is limited to 35 characters.
LIMIT Specifies how many generation data sets are to be maintained in the group. The maximum limit is 255.
EMPTY | NOEMPTY Specifies what action should be taken when the LIMIT value is reached. EMPTY means that all generations should be removed from the group. NOEMPTY means that just the oldest generation should be removed.
SCRATCH | NOSCRATCH Specifies whether the data sets that are removed from the group should be scratched (deleted) or just un-cataloged.
TO | FOR Specifies an expiration date or a retention period for the GDG.

Sample JCL to  define a generation data group (GDG) 

//JOB123 JOB (12345),'RC MAINFRAME', CLASS=0,
//           SPACE=(CYL,(10,10),RLSE),
//           DCB(DSORG=PS,RECFM=FB,LRECL=80)
  LIMIT(30) -

Note: In above mention example, job would define new Generation Data Group (GDG) base (i.e. RCTM.EMPPAYRL.MNTH.GDG) with limit as 30. We have used IDCAM's utility to define, however same can be achieve FILE-AID / FILE-MANAGER or using ISPF utility. 

DELETE Generation Data Group (GDG) Syntax.

DELETE  entry-name
        [ PURGE|NOPURGE ]

        [ FORCE|NOFORCE ]

entry-name Provide the name of the GDG catalog entry that is to be deleted.
GDG Specifies that the entry to be deleted is a generation data group.
PURGE Deletes the catalog entry even if the expiration date hasn’t been reached. When used with FORCE, it deletes the catalog entry and the GDG members even if any of their expiration dates haven’t been reached.
FORCE Forces the GDG catalog entry and all of its members to be deleted, assuming that the expiration dates have passed or that PURGE is coded.

Sample JCL to  delete a generation data group (GDG) 

//JOB123 JOB (12345),'RC MAINFRAME', CLASS=0,
 PURGE                            –

What is a Generation Data Group (GDG) ?

No comments:

Post a comment