When a JCL GDG Generation Is Missing: Separate Normal Roll-Off from a Catalog Problem
A downstream job cannot find a GDG generation, and the tempting response is to recreate it or alter the relative generation number. That can turn a normal retention event into a data-integrity incident. This runbook shows how to establish what happened before changing JCL or rerunning a producing step.
A downstream job cannot find a GDG generation, and the tempting response is to recreate it or alter the relative generation number. That can turn a normal retention event into a data-integrity incident. This runbook shows how to establish what happened before changing JCL or rerunning a producing step.
The dataset names and job fragments below are fictional. GDG limits, retention policies, catalog tools, scheduler conventions, and recovery authority vary by site. Do not define a replacement base, uncatalog a dataset, or rerun an updating job solely because a relative generation appears to be missing.
Trigger: a step reports that its GDG input cannot be found
A common support ticket starts after a consumer step fails to allocate a dataset such as ACME.PAYROLL.EXTRACT(-1). The failure may be an allocation message, an IEF message, a utility failure, or an application-level file-open error. The notation is important: a relative GDG reference is resolved when the job is processed; it is not a permanent dataset name.
Consider this simplified two-job flow:
//MAKEEXT JOB ...
//EXTRACT EXEC PGM=PAYXTRCT
//OUTFILE DD DSN=ACME.PAYROLL.EXTRACT(+1),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(20,10)),UNIT=SYSDA
//
//LOADPAY JOB ...
//INFILE DD DSN=ACME.PAYROLL.EXTRACT(-1),DISP=SHR
//STEP01 EXEC PGM=PAYLOAD
Assume that the GDG base has a limit of seven generations. After eight successful cataloged outputs, the oldest entry may roll off according to the base definition and site policy. In that case, a request for an old absolute generation is not evidence of a catalog failure. Conversely, if the expected newest generation is absent immediately after a reported-successful producer job, the case needs a different diagnosis.
Treat the job log as evidence, not as a verdict. A zero job return code does not by itself prove that the expected GDG was cataloged, and a missing relative reference does not identify which physical generation the consumer meant to read.
Preconditions before investigating or acting
1. Identify the GDG base name, the failing job and step, and the exact JCL that the scheduler submitted. A PROC override can change the reference actually used.
2. Capture the allocation or open failure messages and the time of the failure.
3. Obtain the producer job ID, completion time, and its relevant step output if the consumer expects a newly created file.
4. Check the scheduling dependency and business-cycle date. A job can be logically late, skipped, or pointed to a prior cycle while the catalog itself is healthy.
5. Confirm whether the operation is read-only or whether a proposed rerun can update DB2 tables, VSAM files, queues, or external interfaces.
Do not start with a guessed relative number. (-1) means the prior cataloged generation at resolution time, not necessarily “yesterday's file.” If another generation was created in between, or a run was repeated, the business meaning and the GDG ordering can diverge.
Decision path: retention, resolution, creation, or catalog state
Use a site-approved catalog display or ISPF dataset utility to inspect the GDG base and its current entries. Record the absolute generation dataset names, creation dates, catalog state, and base attributes. The exact command and output format are installation-specific; the point is to capture the base state before anyone changes it.
| Observation | Likely interpretation | Safe next action |
| --- | --- | --- |
| The required absolute generation is older than the retained list and the base is at its limit | Normal roll-off is plausible | Confirm retention policy and whether an approved archive or backup exists |
| The producer created a generation, but its DD disposition did not catalog it | Creation or disposition logic needs review | Review the producing step and recovery plan; do not assume a rerun is harmless |
| The producer step abended before allocation or catalog completion | The input was never made available | Diagnose the producer failure before considering recovery |
| The current list is present, but consumer (-1) identifies the wrong business file | Relative-reference timing or scheduling changed | Resolve the intended absolute generation and correct the dependency/design through change control |
| Catalog records and physical dataset availability disagree | Catalog or storage support may be required | Preserve evidence and follow the site's catalog recovery procedure |
A short plain-text flow is often enough for an incident note:
Consumer failure
-> Which absolute generation did its relative reference resolve to?
-> Is the business-required generation in the GDG base list?
-> yes: check dependency, PROC override, and reference semantics
-> no: did the base limit legitimately roll it off?
-> yes: locate approved retained copy or raise retention change
-> no: inspect producer output and involve catalog/storage support
The first question is deliberately about the absolute generation. For example, ACME.PAYROLL.EXTRACT.G0012V00 is a specific catalog entry; ACME.PAYROLL.EXTRACT(-1) is a moving reference. Recording both prevents later discussion from confusing a business date with a generation sequence.
Worked support example: why changing `(-1)` to `(0)` is not a fix
Suppose a nightly producer normally creates one extract and the loader normally reads (-1) during a later job. One evening the producer is restarted after a non-output step failed, but the restart point is selected incorrectly and the output step executes again. There may now be two generations for the same business date.
An analyst sees a loader issue and changes the input from (-1) to (0) to make the job allocate a file. That may allow the job to run, but it silently switches the business input. It could load a partial file, a duplicate-cycle file, or an output that was not reconciled with the control totals.
Instead, capture an evidence set:
- GDG base attributes, current absolute entries, and their catalog timestamps.
- Producer job IDs, restart history, return codes, and messages for the output DD.
- Consumer job ID, expanded JCL/PROC values, and the resolved input name if shown in allocation messages.
- File record counts, byte counts, and header/trailer or control-total values where the interface provides them.
- Scheduler dependency history and the agreed business date for the cycle.
- Whether any later job could already have consumed either candidate file.
With that evidence, the right answer may be to process one explicitly named, approved absolute generation in a controlled recovery job. Or the right answer may be to stop because the interface owner must determine which output is authoritative. The original relative reference should not be casually changed in production to solve a one-time incident.
Before rerun or recovery
A rerun decision needs more than “the file is missing.” Check these items with the appropriate application, scheduling, database, and storage owners:
- Has any update step already committed work for this cycle?
- Is the proposed restart before or after the generation-creating step?
- Would the producer create a second generation, overwrite a non-GDG target, send an outbound file, or post duplicate messages?
- Is the required input truly unavailable, or is it available under an absolute name or approved archive location?
- Do record counts and trailer totals identify one candidate output as complete?
- Does the recovery JCL use a temporary, explicitly reviewed override rather than a permanent production-source edit?
- Is there a documented decision on whether a new GDG generation is acceptable for the business date?
For a catalog discrepancy, avoid DIY repair steps such as deleting catalog entries or defining a new base with similar attributes. Those actions can hide the original condition and make recovery harder. Escalate with the captured absolute names, job evidence, and timestamps.
Design improvement after the incident
Where the interface contract is business-date based, consider recording the produced absolute GDG name and business date in a controlled run-control record or scheduler-visible handoff. The consumer can then validate that it is receiving the expected cycle rather than relying only on a relative position. This is a design change, not an emergency edit: it needs failure-path testing, restart design, and agreement on retention.
A GDG is excellent for ordered generations, but it is not automatically a business-calendar guarantee. Make the business identity explicit when that distinction matters.
Practical takeaway
When a GDG input is missing, first prove the resolved absolute generation, the retained catalog list, and the producer outcome. Only then decide whether the issue is normal roll-off, a dependency error, an incomplete creation, or a catalog/storage case—and keep any rerun under documented recovery control.