Retrieving a generation data set

To retrieve an SMS-managed generation data set, always code the DSNAME and DISP parameters.

To retrieve a non-SMS-managed generation data set, always code the DSNAME and DISP parameters. Optional parameters are the UNIT, VOLUME, LABEL, and DCB.

DSNAME Parameter: For both SMS-managed and non-SMS-managed data sets, use the DSNAME parameter to retrieve a single generation data set or all of the generation data sets in the GDG.

To retrieve a single generation data set, code in the DSNAME parameter the name of the generation data group followed by a relative generation number in parentheses. The number indicates which generation data set is to be retrieved. To retrieve the most recent data set, code a zero.

To retrieve data sets created before the most recent data set, code a minus value, -1 to -255. The value of nnn indicates the relation of the desired data set to the most current data set: (-1) refers to the data set created immediately before the most recent data set; (-2) refers to the data set created before the data set identified by (-1).

For example:

PAYROLL Name of the GDG
DSNAME=PAYROLL(0) This week's generation data set
DSNAME=PAYROLL(-1) Last week's generation data set
DSNAME=PAYROLL(-2) Generation data set of two weeks ago

Relative generation numbers are maintained by the system only when generation data sets are specified using relative generation numbers.

Note: Refer to generation data sets in a deferred roll-in state by their relative number, such as (+1), within the job that creates it. Refer to generation data sets in a deferred roll-in state by their absolute generation number (GxxxxVyy) in subsequent jobs. For more information on how to refer to GDG data sets in a deferred roll-in state, see z/OS DFSMS Using Data Sets.