Skip to main content

DISPOSITION 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)
FieldMeaning
statusDataset access type: NEW, OLD, MOD, or SHR
normal-dispWhat to do if the step ends normally (KEEP, CATLG, etc.)
abend-dispWhat to do if the step ends abnormally (DELETE, etc.)

DISP Status – Dataset Access Modes

StatusPurposeLock Behavior
NEWCreate a new datasetExclusive ENQ
OLDUse existing dataset exclusivelyExclusive ENQ
MODAppend to or create a datasetExclusive ENQ
SHRShared read-only accessShared ENQ
note

🔐 OLD, NEW, MOD block other access due to exclusive ENQ. ✅ SHR allows concurrent read access.

DISP Lifecycle Control – Normal and Abnormal Dispositions

ValueMeaning
KEEPRetain dataset, do not catalog unless already cataloged
CATLGKeep and catalog the dataset
DELETEDelete the dataset
PASSPass dataset to next step in same job
UNCATLGRemove from catalog but keep data physically

DISP Defaults (If Values Are Omitted)

Dataset TypeDefault DISP Value
New dataset(NEW,DELETE,DELETE)
Existing dataset(OLD,KEEP,KEEP)
Only status givenAssumes 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 DISPJob B DISPLocking ResultWhy It Happens
SHRSHR✅ AllowedBoth jobs request shared (read-only) access.
SHROLD / MOD❌ Job B must waitMOD implies a write operation, so SHR readers must release the dataset.
OLD / MODOLD / MOD❌ One must waitBoth need exclusive access; only one can proceed at a time.
OLD / MODSHR❌ Job B must waitDISP=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 or UNCATLG and is not cataloged, you’ll need VOL=SER=... to access it manually.
  • DISP=SHR allows only reading—not deletion or writing.

Reference Table

DISPUse CaseLockBehavior if Step Succeeds / Fails
(NEW,CATLG,DELETE)Create new, catalog if OKEXCLCatalog or delete dataset
(OLD,KEEP,KEEP)Use existing safelyEXCLDataset is retained manually
(MOD,KEEP,DELETE)Append or createEXCLKeep if OK; delete if failed
(NEW,PASS,DELETE)Temporary passed datasetEXCLAuto passed to next step
DISP=SHRRead-only shared datasetSHRDManually 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."