Generation Data Groups (GDGs) are a z/OS catalog facility—not an Easytrieve language feature. Your Easytrieve program still declares FILE PAYFILE SEQUENTIAL FB(80 800); JCL decides whether PAYFILE points at generation g0005v00, the current generation (0), the next output generation (+1), or yesterday (-1). Operations love GDGs for daily extracts, monthly archives, and rolling retention without changing program source every run. The base name groups generations; each gnnnnv00 dataset is a sequential generation with its own DCB attributes often copied from a model DSCB. Beginners stumble on relative generation numbers, DISP on (+1) output, and the difference between the GDG base and a specific generation. This page teaches how Easytrieve interacts with GDGs through DD names only, input patterns for current and prior generations, output (+1) creation, LIMIT rollover, model DSCB alignment with FILE record format, empty generation handling, and coordination with SORT and downstream jobs that expect a new g-number after your Easytrieve step completes.
A GDG base is a catalog entry listing generations. IDCAMS DEFINE GDG (NAME(base) LIMIT(n) ...) creates the base. Each job that allocates (+1) adds a new sequential dataset cataloged as base.g0007v00 for example. LIMIT 7 keeps seven generations; when generation 8 is added, the oldest may uncatalog and delete per SCRATCH rules. Easytrieve never sees the base name in source—only the DD resolved at JCL execution. That separation means the same compiled program runs nightly; only JCL generation references change, often via scheduler variables.
12345678910FILE PAYIN FB(120 2400) EMP-NO 1 9 N PAY-AMT 10 7 P 2 FILE PAYOUT FB(120 2400) OUT-REC 1 120 A JOB INPUT PAYIN MOVE PAY-REC TO OUT-REC PUT PAYOUT
PAYIN and PAYOUT are ordinary sequential files. Whether PAYIN is a flat PS file or generation PAY.GDG(0) is invisible to Easytrieve if LRECL matches FB(120 ...). PAYOUT PUT writes to whatever DD PAYOUT maps to—often PAY.GDG(+1) for a new daily outbound generation. Field layouts must match across generations in a GDG chain so downstream jobs read consistent record formats.
| DSN reference | Meaning | Typical DISP |
|---|---|---|
| BASE.GDG(+1) | New generation for output | NEW,CATLG,DELETE |
| BASE.GDG(0) | Current (latest) generation | SHR or OLD |
| BASE.GDG(-1) | Previous generation | SHR |
| BASE.GDG(+0) | Current generation for in-place update (site policy) | OLD |
| BASE.GDG.G0003V00 | Absolute generation name | SHR |
(+1) is the most common Easytrieve output pattern: create new generation, catalog, delete on abnormal step end. (0) reads today's current file—input for restart or reconciliation jobs. (-1) compares against yesterday. Absolute g-names appear in audit documentation or recovery JCL when relative numbers are ambiguous after catalog repair.
123456//PAYIN DD DSN=FIN.PAYROLL.GDG(0),DISP=SHR //PAYOUT DD DSN=FIN.PAYROLL.GDG(+1), // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(5,2)), // DCB=(RECFM=FB,LRECL=120,BLKSIZE=2400) //SYSIN DD DSN=PROD.EZT.SRC(PAYRPT),DISP=SHR
PAYIN DD name matches FILE PAYIN. Current generation (0) is shared read. PAYOUT (+1) creates the next generation with explicit DCB matching FILE FB(120 2400). Omitting DCB on (+1) may still inherit model DSCB from GDG definition—verify with LISTCAT and model attributes. SPACE on (+1) must be large enough for peak pay extract volume or the PUT loop ABENDs mid-job.
GDG model dataset supplies default RECFM, LRECL, BLKSIZE for new generations. Easytrieve FILE FB must agree. If model says LRECL 120 but FILE declares FB(100 1000), I/O fails at open or first PUT. When operations change model during migration, revalidate all Easytrieve libraries referencing that GDG output DD. ASA printer GDGs are rare for Easytrieve REPORT; most report GDGs are standard FB sequential files written via PUT or extract activities.
Input-only jobs: JOB INPUT on PAYIN with DD (0) or (-1), REPORT to SYSPRINT or SYSOUT—no GDG output. Output-only jobs: JOB INPUT on a non-GDG staging file, PUT PAYOUT to (+1)—feeds downstream SORT or load. Pass-through jobs: read (0), write (+1), rolling the chain forward one generation per successful run. Failed runs before CATLG may leave uncataloged scratch datasets—operations clean with IEFBR14 or catalog tools; Easytrieve does not manage GDG catalog entries itself.
GDG generations are cataloged sequential datasets with retention policy. Temporary && datasets in JCL die at job end unless passed. Easytrieve FILE VIRTUAL is internal VFM—not a GDG. Choose GDG when auditors need dated generations; choose temporary when scratch space is enough inside one job. See temporary-files tutorial for && and VIRTUAL contrast.
Control-M, OPC, and other schedulers often substitute symbolic variables for generation numbers in JCL—still sequential FILE in Easytrieve. Document whether production uses (0) input or absolute g-name for restart after abend. Some shops bump (+1) only in a final production step while test uses fixed g0001v00 to avoid polluting production GDG chains.
A new (+1) output generation starts empty; first PUT writes record 1. Reading an empty input generation yields immediate EOF on JOB INPUT—handle with zero-record report or NOTIFY logic in procedures. Do not assume prior generation had data; reconciliation jobs compare (-1) versus (0) counts on SYSPRINT.
A GDG is a stack of notebooks with the same title but different day stickers. Notebook (+1) is a blank new notebook you write in today. Notebook (0) is the one on top right now. Notebook (-1) is yesterday's underneath. Easytrieve only knows how to read and write pages—it does not pick which notebook. The JCL card tells the computer which notebook to open for PAYIN and PAYOUT. The library keeps only seven notebooks (LIMIT); the oldest is thrown away when an eighth is added.
1. Easytrieve declares a GDG generation with:
2. DSN=REPORT.GDG(+1) in JCL typically means:
3. DSN=REPORT.GDG(0) usually refers to:
4. GDG base is defined with:
5. When a GDG rolls off LIMIT: