0% found this document useful (0 votes)
26 views

GDG

The document outlines the process of defining and using Generation Data Groups (GDGs) in JCL, including creating a model data set and GDG index. It provides example JCL code for defining a GDG, creating its versions, and utilizing the GDG in subsequent jobs. The document emphasizes the importance of specifying parameters correctly to ensure proper data set management and usage.

Uploaded by

balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

GDG

The document outlines the process of defining and using Generation Data Groups (GDGs) in JCL, including creating a model data set and GDG index. It provides example JCL code for defining a GDG, creating its versions, and utilizing the GDG in subsequent jobs. The document emphasizes the importance of specifying parameters correctly to ensure proper data set management and usage.

Uploaded by

balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

GENERATION DATA GROUPS:

Define GDG and the model data set allocation.

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,


// MSGLEVEL=(1,1),REGION=6M,NOTIFY=&SYSUID
//* JOB TO CREATE THE MODEL AND GDG INDEX
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//MODEL DD DSN=IND220.INDUS.MODEL.STUDENT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,0),
// UNIT=SYSDA,
// DCB=(DSORG=PS,RECFM=FB,LRECL=44,BLKSIZE=440)
//SYSIN DD *
DEFINE GDG(NAME(IND220.INDUS.STUDENT.GDG) -
LIMIT(3) -
NOEMPTY -
SCRATCH)
/*
//

Creating the GDG versions

//IND220VI JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),


// NOTIFY=&SYSUID
//STEP1 EXEC PGM=WRIPGM
//STEPLIB DD DSN=IND220.INDUS.LOADLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//DD1 DD DSN=IND220.INDUS.STUDENT.GDG(+1),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,1),RLSE),
// UNIT=SYSDA,
// VOL=SER=OZAV07,
// DCB=(IND220.INDUS.MODEL.STUDENT)
//SYSIN DD *
1111
VIJAY
TANUKU
YES
2222
BHASKAR
TANUKU
YES
3333
ANDUKURI
TANUKU
NO
/*
//

CREATING MODEL
Once the index has been created, a model data set must be created.
This model data set contains specifications for the DCB subparameters
for all data sets that will belong to that GDG. Programmer can override
this default values if he want.

EXAMPLE JCL

//MYJOB JOB (W983),'KRISHNA REDDY'


//STEP1 EXEC PGM=IDCAMS
//SYSIN DD *
DEFINE GDG( -
NAME(MYLIB.LIB.TEST) -
LIMIT(10) -
NOEMPTY -
SCRATCH)
//STEP2 EXEC PGM=IEFBR14
//MODEL1 DD DSN=MYLIB.LIB.TEST,
// DISP=(NEW,KEEP,DELETE),
// UNIT=SYSDA,
// SPACE(TRK,0),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//
( copyright - www.mainframegurukul.com )

Using IEFBR14, we have created the model, Now GDG is ready to use, In
next section you will learn how we will use this created GDG.

3. USING GDG

To use created GDG in our JCL, we need to use name


(with +1 for new generation) which we used in DEFINE
GDG command. (i.e. MYLIB.LIB.TEST)

EXAMPLE JCL

//MYJOB JOB (SD345),'KRISHNA REDDY'


//STEP1 EXEC PGM=COBPROG
//INFILE DD DSN=MYLIB.LIB.TEST(+1),
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(20,10),RLSE),
// DCB=(MODEL.DCB,RECFM=FB,
// LRECL=80,
// BLKSIZE=800)
//
( copyright - www.mainframegurukul.com )

The program COBPROG is executed. A new generation data set is


created via the statement

//INFILE DD DSN=MYLIB.LIB.TEST(+1)

Since we used (+1) with GDG name, it creates a new generation


data set.
The DISP parameter must be set to CATLG for all new generation
data sets , DISP=(NEW,CATLG,DELETE)

We used MODEL.DCB in DCB parameter to instruct system to use


subparameters specified in model GDG.

You might also like