You are on page 1of 4

A Generation Data Group, often abbreviated GDG, is a facility

of the oper- ating system that keeps track of periodic or


cyclical data sets. As the name suggests, each new data set that
is created forms a new "generation" in a series. Generation data
groups typically follow this pattern:

1. A new generation of the data set is added.

2. Some number of the previous generations of the data


set are
retained.

3. The oldest generation of the data set is deleted.

With normal data set names: With generation data group names:

ACCT.DEC.DATA ACCT.DATA(0)
ACCT.NOV.DATA ACCT.DATA(-1)
ACCT.OCT.DATA ACCT.DATA(-2)

To add a new generation to a generation data group, you just


create a data set with the same name as before and +1 for the
generation:

DSN=data-set-name(+1)

The system then changes all the previous generation names so


that the old (0) becomes (-1), the old (-1) becomes (-2), etc.
Here's an example:

Before job completes: After job completes:

ACCT.DATA(+1) ACCT.DATA(0)
ACCT.DATA(0) ACCT.DATA(-1)
ACCT.DATA(-1) ACCT.DATA(-2)
ACCT.DATA(-2) Deleted--if only 3 generations
were to be kept

With generation data groups, there is no need to change the JCL.


You just run it each time you want to create a new generation.
The system keeps track of generation data groups in the catalog.
Of course, this means that when you specify the disposition for a
new generation data set, you must specify CATLG.
To make things consistent within a given job, generation data
group numbers are not updated at the end of the job step in which
a new generation is created. Instead, they are updated at the
end of the job.

Name you use Name you use Actual name (used during
during the job: after the job: and after the job):

ACCT.DATA(+1) ACCT.DATA(0) ACCT.DATA.G0008V00


ACCT.DATA(0) ACCT.DATA(-1) ACCT.DATA.G0007V00
ACCT.DATA(-1) ACCT.DATA(-2) ACCT.DATA.G0006V00
ACCT.DATA(-2) Deleted ACCT.DATA.G0005V00

name.GnnnnVvv

nnnn is the absolute generation number, 0000-9999.


vv is the version number. Usually this is 00. (You
can create
different versions of the same generation, but not
with JCL, and
we get into that here.)

You must not exceed 10,000 (0000-9999) total generations.


Furthermore, you can keep only 256 ((0) to (-255)) generations
active at any one time. That is, generation data groups are
numbered from 0 to 9999. Only 256 of these can be active at any
one time. So generations 6000 to 6255 could be active, and
generations 0 to 5999 would all be inactive.

The individual generations in a generation data group don't all


have to have the same DCB attributes. The RECFM, LRECL, BLKSIZE,
and even DSORG can all be different. However, the DCB attributes
are usually the same. If they are the same, you can refer to the
generation data group without a generation number.
//jobname JOB ...

// EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

DEFINE GDG ( -

NAME (X2222.ANNUAL.DATA) -

LIMIT(12) -

NOEMPTY -

SCRATCH )

/*

Here's an explanation for the DEFINE statement used to create a


generation data group base entry:

DEFINE GDG ( -
(The items following GDG are enclosed in parentheses.
The - indi-
cates that the statement is continued.)

NAME (generation-data-group-name) -

LIMIT(generations) -
(The number of generations to be kept. The value can
be 1 through
255.)

NOEMPTY -
(This tells what to do with the old generations.
Coding NOEMPTY
requests that the LIMIT number of newest generations
be kept and
the remainder be deleted. If you code EMPTY instead,
all the old
generations are deleted, and only the (+1) generation
is kept when
the LIMIT is reached.)
NOEMPTY - When the LIMIT number is exceeded, NOEMPTY keeps the
LIMIT
number of newest generations.

EMPTY - When the LIMIT number is exceeded, EMPTY keeps only the
most recent generation.

You might also like