JCL

JCL Temporary Dataset Missing Between Steps: Diagnose DISP=PASS Before a Rerun

A later batch step can fail because a temporary data set was never made available to it, even though the creating step appears to have completed. This guide shows how to distinguish a `DISP=PASS` lifecycle problem from a wrong step name, a conditional bypass, or a restart that invalidates the original job context.

Job stepReturn codeSafe decisionNext step
Original DBala learning flow — a visual summary of this article’s practical decision path.

A later batch step can fail because a temporary data set was never made available to it, even though the creating step appears to have completed. This guide shows how to distinguish a DISP=PASS lifecycle problem from a wrong step name, a conditional bypass, or a restart that invalidates the original job context.

The data set names, program names, and return codes below are fictional. Local allocation, scheduler, storage-management, and restart standards vary. Do not rerun a job, change disposition, or replace an intermediate file merely to make a “data set not found” message disappear.

Symptom: a downstream step cannot open its intermediate input

Consider a two-step extract-and-load job. EXTRACT creates a temporary sequential data set. LOAD consumes it within the same job.

//EXTRACT  EXEC PGM=EXTRCT01
//OUTDD    DD  DSN=&&TXNOUT,
//             DISP=(NEW,PASS,DELETE),
//             UNIT=SYSDA,SPACE=(CYL,(5,2)),
//             DCB=(RECFM=FB,LRECL=120,BLKSIZE=0)
//*
//LOAD     EXEC PGM=LOADR02
//INDD     DD  DSN=&&TXNOUT,DISP=(OLD,DELETE)

The intended meaning is simple but important:

A failure at LOAD may show an allocation message, an application open failure, or a file-status symptom. None of those messages alone proves that EXTRACT failed to write records. The problem might instead be that LOAD did not run in the same execution context as the creator, or that the temporary data set’s disposition changed before it could be passed.

Evidence to capture before changing the JCL

Collect the job log and step output for the actual failed execution, not a prior successful run. The useful evidence is usually small and specific:

1. The completion code and condition-code messages for every step before LOAD.
2. Allocation and deallocation messages for &&TXNOUT, including the resolved temporary data set name if the spool shows one.
3. The exact OUTDD and INDD DD statements after PROC expansion or scheduler substitution.
4. Whether an IF/THEN/ELSE, COND, or scheduler rule bypassed EXTRACT or LOAD.
5. The restart point used, if this is a restarted job, and whether the site’s restart mechanism preserves temporary data sets.
6. Any utility or exit between the two steps that references the same DD name or data set.

Also check the JES job log sequence. A PASS relationship is based on steps in one submitted job. Similar-looking DD statements in a separate submitted job are not connected just because they use the same && name.

Diagnosis path: follow the data set’s lifecycle

Start with the producer step, then move forward one decision at a time.

### 1. Did the producer actually execute and complete acceptably?

A return code of 00 is helpful, but it is not the only condition to inspect. A step can complete with a site-accepted warning code while producing an empty file; conversely, a condition code can cause later steps to be skipped. Confirm that EXTRACT ran, that allocation succeeded, and that its program reached the point where it writes OUTDD.

Do not infer record creation from the presence of the DD statement in JCL. The job log and program output must support it.

### 2. Was the normal disposition really PASS?

The three disposition positions have different jobs:

DISP=(status,normal-termination,abnormal-termination)
        |        |                  |
        |        |                  +-- action if creating step abends
        |        +--------------------- action if creating step ends normally
        +------------------------------ data set status at allocation

For a producer-consumer temporary file, DISP=(NEW,PASS,DELETE) is common. A subtle but material change to DISP=(NEW,DELETE,DELETE) deletes the file after a normal producer completion, leaving no input for LOAD. DISP=(NEW,CATLG,DELETE) is a different design: it catalogs a permanent name and needs an ordinary DSN, not an && temporary name.

Review the expanded JCL, not only the member someone edited. A PROC override or symbolic parameter can alter a DD statement in the submitted job.

### 3. Did a condition bypass one half of the pair?

A temporary file is not a durable restart checkpoint. If EXTRACT is skipped but LOAD runs, the input is absent. If EXTRACT ran in an original execution and a restart begins at LOAD, the original temporary file may no longer exist.

Use a simple decision table before proposing a rerun:

| Observed condition | Likely interpretation | Safe next action |
| --- | --- | --- |
| Producer bypassed; consumer ran | Flow-control defect | Review IF/COND logic and intended dependency |
| Producer ended normally; normal DISP is DELETE | File removed as directed | Correct the lifecycle design in test, then validate flow |
| Restart begins at consumer | Original temporary file is not a restart asset | Recreate input through an approved restart path |
| Producer abended; third DISP value is DELETE | Cleanup is expected | Diagnose producer failure before any restart |
| Both steps ran in same job and PASS is present | Look for DD override, allocation error, or consumer mismatch | Compare spool allocation messages and expanded DDs |

### 4. Is the consumer asking for the same object?

For temporary data sets, the consumer should normally reference the same && name in the same job. A typo, a PROC-generated suffix, or an unexpected DD override can make LOAD request a different temporary object. Check record attributes as well: a data set can exist and still fail at open because RECFM, LRECL, or organization does not match what the program expects. That is a separate diagnosis from a missing data set.

Safe correction patterns

Choose a correction based on the required recovery model, not on the quickest way to get the next step started.

If the intermediate data is needed only within one uninterrupted job, keep it temporary and use a deliberate PASS relationship. Make the condition logic ensure that the consumer cannot run when its producer was bypassed.

If the process must restart at a later step, a temporary data set is usually the wrong recovery boundary. A controlled design may use a named, generation-managed or run-identified intermediate data set, along with validation that it belongs to the correct business date and run. That decision has retention, security, cleanup, and duplicate-processing implications; follow local standards and change control.

Do not casually switch &&TXNOUT to a cataloged permanent data set in production. A permanent name can accidentally reuse stale data, collide with another run, or expose a partial extract to a downstream process.

Before rerun: support checklist

The practical rule is: DISP=PASS is a same-job handoff, not a recovery guarantee. Prove the producer ran, the normal disposition retained the file, the consumer remained in the same job flow, and no restart broke that lifecycle before choosing the next action.

← Back to all articles