Generation Data Group (GDG)
A Generation Data Group (GDG) is a logical grouping of related sequential files (generations) that are produced and consumed over time by Job Control Language (JCL) jobs. Instead of overwriting a file each time a job runs, a new generation is created and older generations are retained for a defined number of cycles. This enables restart/recovery scenarios, auditing, and historical analysis. A Generation Data Group (GDG) is used when a migrated application originated on an IBM mainframe.
GDGs let scripts reference the latest or earlier versions of a file without hard-coding an absolute filename. The AMT JCL Library manages a catalog so jobs can request generations relatively (for example, the most recent, the previous, etc.).
File Cycles
A File Cycle is a cycle that refers to an individual version or generation of a file. Centralized control of per-GDG cycle limits is available through the GDG Catalog file. When no explicit configuration is provided, the maximum number of File Cycles for a GDG defaults to 255. The maximum number of cycles is 9999.
The following occurs if a JCL script refers to a File Cycle:
- If no GDG and no file exists: AMT creates a GDG folder with a
gdg-config.yamlfile containingmaxActiveCycles: <gdg catalog value>. A new cycle is added only if the reference requires it. - If no GDG but a file does exists: AMT creates a GDG folder with a
gdg-config.yamlfile containingmaxActiveCycles: <retained value>, and uses the existing file as the first cycle. Additional cycles are created if needed.
The JCL script then continues and performs actions based on the given context.
GDG Dataset Naming
IBM File Cycle names follow a specific pattern that includes generation and version information:
<Filename>.GnnnnV00. "nnnn" is the generation number for the IBM File Cycle and "V00" is the
version number. New File Cycles are created with version number 00.
GDGs can be referenced using relative or absolute generation notation:
- Relative:
MYGDG(+1),MYGDG(0),MYGDG(-2) - Absolute:
MYGDG.G0001V01,MYGDG.G0315V00
Relative references are resolved at execution time to their corresponding absolute generation.
Mainframe IDCAMS
On the mainframe, per-GDG limits are often managed with IDCAMS
DEFINE GDG ... LIMIT(n) or ALTER ... LIMIT(n). Examples:
//STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE GDG (NAME(userid.MYGDG.TEST) LIMIT(15)) /*
//STEP2 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * ALTER userid.MYGDG.TEST LIMIT(50) /*
| AMT JCL Limits |
|---|
AMT JCL does not currently process IDCAMS GDG DEFINE or ALTER statements. Use the GDG Catalog file to apply
limits
centrally, to manage limits for all GDGs in one place. Existing GDG directories retain their prior
gdg_config.yaml value until removed.
|
IDCAMS instructions only apply to a single GDG at a time. If multiple GDGs with different limits need to be managed, it would require creating a JCL script that creates or modifies each GDG individually. As an alternative, support was added for a GDG catalog that allows you to define all GDGs and their maximum number of cycles beforehand. See GDG Catalog file for more information.
