Is gdg is created in ps or pds

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Is gdg is created in ps or pds

Postby steve-myers » Wed Jan 08, 2020 9:03 am

By pure accident I came across this 12 year old topic. Sadly, the only response was from the late Dick Scherrer. Since there is little point in adding to the topic, I decided to start from scratch.
  • Before you can create a GDG data set you have to define a GDG index. You do this with IDCAMS, us nearly extinct dinosaurs might do this using IEHPROGM, or as a valid, though infrequently used method, from the TSO READY prompt using DEFINE GDG(NAME(...) ...). The DEFINE command, whether it is entered in TSO or in batch using IDCAMS have the same syntax.

    FIFO | LIFO )

    The defaults are underlined. You can use GDG rather than GENERATIONDATAGROUP.

    At a minimum you must enter two parameters and their related keywords: the GDG name and the maximum number of data sets to catalog in the GDG index.

    Originally, a GDG index was limited to 256 data sets. Now you can specify a larger limit, up to 999, when you also specify the EXTENDED option.

    The FIFO and LIFO option specifies the order in which the data sets cataloged in a GDG appear when you list the entire index. The default goes back to OS/360.

    EMPTY directs the system to delete every data set in the GDG index when the index is at its limit and there is a requirement to add a new generation to the GDG index.
  • You create new data set in a GDG index by specifying a positive relative index - typically (+1) in JCL.

    //NEWGDG   DD  DSN=GDGindex(+1),DISP=(NEW,CATLG),...
  • You can retrieve GDG data sets in JCL by specifying its relative index as either (0) or as (-n).You cannot use relative indexes in TSO. They can be used in FTP, though with extreme care. The FTP issues are beyond the scope of this post.
    //OLDGDG   DD  DSN=GDGindex(0),DISP=OLD

    In JCL, a relative GDG maps to its corresponding data set at the time the job started. It does not change. For example, in step B in this JCL, relative generation (0) is the same data set as it was when the job started
    //SYSUT1   DD  ...
    //SYSUT2   DD  DSN=GDGindex(+1),DISP=(NEW,CATLG),...
    //B       EXEC PGM=COMPARE
    //NEWDS    DD  DSN=GDGindex(+1),DISP=OLD
    //OLDDS    DD  DSN=GDGindex(0),DISP=OLD
Now to answer the original query in the topic.

Yes, you can create a partitioned data set in a GDG.
//             SPACE=(TRK,(primary,secondary),blocks),...

What you cannot do is specify a member name in the JCL. The sample DD statement might be used with IEBCOPY, but it would not be appropriate for IEBGENER.
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Return to JCL


  • Related topics
    Last post