DISP
OSITION Parameter
In JCL, dataset management revolves heavily around the DISP
parameter, which defines how a dataset is accessed, retained, or discarded during and after a job step.
It controls:
- At the start of a step – is it created new, reused, shared, or modified?
- At the end of a step – should it be kept, deleted, cataloged, etc.?
This ensures data safety, efficient resource use, and predictable job behavior. Improper DISP usage can lead to dataset contention, accidental deletion, or failure to catalog newly created files.
Especially in multi-step jobs, DISP=PASS
plays a key role in passing temporary datasets across steps. Overall, DISP acts as a lifecycle controller for datasets in z/OS batch processing.
🧠 Real-World Usage
- Create and catalog output files
- Share input datasets across steps/jobs
- Pass temporary datasets to later steps
- Delete unneeded datasets automatically
- Prevent simultaneous updates using system locks
🔎 DISP Syntax
DISP=(status, normal-disp, abend-disp)
Field | Meaning |
---|---|
status | Dataset access type: NEW , OLD , MOD , or SHR |
normal-disp | What to do if the step ends normally (KEEP , CATLG , etc.) |
abend-disp | What to do if the step ends abnormally (DELETE , etc.) |
DISP Status – Dataset Access Modes
Status | Purpose | Lock Behavior |
---|---|---|
NEW | Create a new dataset | Exclusive ENQ |
OLD | Use existing dataset exclusively | Exclusive ENQ |
MOD | Append to or create a dataset | Exclusive ENQ |
SHR | Shared read-only access | Shared ENQ |
🔐 OLD
, NEW
, MOD
block other access due to exclusive ENQ.
✅ SHR
allows concurrent read access.
DISP Lifecycle Control – Normal and Abnormal Dispositions
Value | Meaning |
---|---|
KEEP | Retain dataset, do not catalog unless already cataloged |
CATLG | Keep and catalog the dataset |
DELETE | Delete the dataset |
PASS | Pass dataset to next step in same job |
UNCATLG | Remove from catalog but keep data physically |
DISP Defaults (If Values Are Omitted)
Dataset Type | Default DISP Value |
---|---|
New dataset | (NEW,DELETE,DELETE) |
Existing dataset | (OLD,KEEP,KEEP) |
Only status given | Assumes OLD (OLD,KEEP,KEEP) |
🔐 Dataset Locking Scenarios
On z/OS, datasets must be protected from simultaneous access that could cause data corruption. This is managed by the DISP parameter in JCL, which internally uses ENQ (enqueue) locking mechanisms.
Depending on how you set DISP (SHR, OLD, MOD), the system decides whether to allow shared access (read-only) or demand exclusive access (read/write). When two jobs try to use the same dataset at the same time, z/OS resolves the conflict based on lock levels. If both jobs can’t proceed safely, one waits until the dataset is released, and the user sees contention messages like:
Job A DISP | Job B DISP | Locking Result | Why It Happens |
---|---|---|---|
SHR | SHR | ✅ Allowed | Both jobs request shared (read-only) access. |
SHR | OLD / MOD | ❌ Job B must wait | MOD implies a write operation, so SHR readers must release the dataset. |
OLD / MOD | OLD / MOD | ❌ One must wait | Both need exclusive access; only one can proceed at a time. |
OLD / MOD | SHR | ❌ Job B must wait | DISP=OLD requests exclusive access, so shared reads must wait. |
Summary
DISP=OLD
requires the dataset to already exist, or the job fails.DISP=MOD
tries to open and append—if not found, it creates the dataset.DISP=PASS
datasets are temporary and available only within the same job.- If a dataset is
KEEP
orUNCATLG
and is not cataloged, you’ll needVOL=SER=...
to access it manually. DISP=SHR
allows only reading—not deletion or writing.
Reference Table
DISP | Use Case | Lock | Behavior if Step Succeeds / Fails |
---|---|---|---|
(NEW,CATLG,DELETE) | Create new, catalog if OK | EXCL | Catalog or delete dataset |
(OLD,KEEP,KEEP) | Use existing safely | EXCL | Dataset is retained manually |
(MOD,KEEP,DELETE) | Append or create | EXCL | Keep if OK; delete if failed |
(NEW,PASS,DELETE) | Temporary passed dataset | EXCL | Auto passed to next step |
DISP=SHR | Read-only shared dataset | SHRD | Manually managed, read-only |
Mastering the DISP
parameter means mastering safe dataset lifecycle management in JCL. It's not just about syntax—it's about protecting data and coordinating job flow reliably in production environments.
✨ "DISP isn't just a parameter—it's a contract between your job and your storage."