Easytrieve GDG File Processing

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.

Progress0 of 0 lessons

GDG Concepts for Easytrieve Developers

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.

FILE Declaration Unchanged

text
1
2
3
4
5
6
7
8
9
10
FILE 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.

JCL Generation References

Common GDG relative references in JCL
DSN referenceMeaningTypical DISP
BASE.GDG(+1)New generation for outputNEW,CATLG,DELETE
BASE.GDG(0)Current (latest) generationSHR or OLD
BASE.GDG(-1)Previous generationSHR
BASE.GDG(+0)Current generation for in-place update (site policy)OLD
BASE.GDG.G0003V00Absolute generation nameSHR

(+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.

Sample JCL with Easytrieve

text
1
2
3
4
5
6
//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.

Model DSCB and Record Format

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 Versus Output-Only GDG Jobs

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.

GDGs Versus Temporary Datasets

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.

Scheduler and Variable Generation

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.

Empty Generation and EOF

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.

Common GDG Mistakes

  • Searching for FILE GDG syntax in Language Reference—there is none.
  • DISP=SHR on (+1) output—should be NEW for new generation.
  • LRECL mismatch between model DSCB and FILE FB.
  • Confusing (0) current with (+1) not yet created.
  • Exceeding LIMIT without monitoring rollover—downstream (-1) may vanish.
  • Pointing VSAM cluster DD at GDG base name without generation.

Testing GDG Easytrieve Jobs

  1. LISTCAT GDG base—note LIMIT, model, existing generations.
  2. Run test JCL with (+1) to small SPACE; verify new g-name cataloged.
  3. JOB INPUT (0); confirm record count matches source.
  4. Rerun with empty input generation; confirm clean EOF handling.
  5. Compare FILE FB to model DCB with IDCAMS or LISTD.

Explain It Like I'm Five

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.

Exercises

  1. Write FILE and JOB INPUT for input (0) and output (+1) DD names.
  2. Draft JCL with model-aligned DCB for a 80-byte FB extract GDG.
  3. Explain LIMIT 5 rollover to a beginner operations trainee.
  4. Contrast GDG (+1) output with &&TEMP DISP=(NEW,DELETE) in one table.
  5. List steps to verify a new generation cataloged after successful Easytrieve run.

Quiz

Test Your Knowledge

1. Easytrieve declares a GDG generation with:

  • FILE name SEQUENTIAL like any sequential dataset; JCL supplies generation
  • Special FILE GDG keyword only
  • SQL table name
  • MACRO GDG

2. DSN=REPORT.GDG(+1) in JCL typically means:

  • Create a new generation on output
  • Read the oldest generation
  • Delete the base
  • Skip catalog

3. DSN=REPORT.GDG(0) usually refers to:

  • The current (latest) generation
  • The model DSCB only
  • A temporary && dataset
  • SYSPRINT

4. GDG base is defined with:

  • IDCAMS DEFINE GDG with LIMIT and models
  • Easytrieve FILE CREATE only
  • ISPF option 3.4 alone
  • CICS transaction

5. When a GDG rolls off LIMIT:

  • Oldest generation uncataloged per GDG rules
  • Easytrieve recompiles
  • FILE statement changes
  • JCL STEPLIB deleted
Published
Read time16 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: z/OS GDG JCL patterns with Easytrieve FILE SEQUENTIAL processingSources: Broadcom Easytrieve 11.6 FILE sequential; IBM z/OS JCL GDG referenceApplies to: Easytrieve batch jobs using generation data groups