JCLbeginner

DD Statements and Dataset Allocation

Understand how DD statements connect a program's logical file references to physical datasets, devices, and allocation parameters.

The DD (Data Definition) statement is the fundamental unit of dataset allocation in JCL, and it's the single most-tested JCL concept in interviews because nearly every job-related question eventually routes through 'what would the DD statement look like for this?' A DD statement bridges a program's internal DDNAME (referenced in COBOL's SELECT/ASSIGN or a utility's control statements) to an actual physical dataset, SYSOUT class, or dummy allocation.

A DD statement is like the shipping label and handling instructions taped to a box — it doesn't just name the box (DSN), it tells the courier whether to open a brand-new box, reuse one already in the warehouse, and what to do with it if the delivery truck crashes en route.

Key Concepts

1
Every DD needs to answer three questions: what dataset (DSN=), how is space allocated if it's new (SPACE=, UNIT=), and what happens to it at step end (DISP=). Getting DISP wrong is the single most common JCL mistake junior candidates make — confusing NEW/OLD/SHR/MOD and the three-part disposition (normal, abnormal-termination) that controls whether a dataset is kept, deleted, or catalogged.
2
DD statements also handle SYSOUT (routing print output to a class, ultimately viewed via SDSF), instream data (via DD * or DD DATA), and DUMMY allocations (for suppressing unwanted output or satisfying a program's file requirement with no actual I/O). Concatenating multiple DD statements under one DDNAME (by omitting the name on subsequent DDs) creates a logical concatenation of datasets read as one sequential stream — commonly used for copybook/library search order (SYSLIB) or reading multiple similarly-structured files as one.
3
A strong interview answer connects DD statement mechanics to real operational consequences: e.g., explaining that DISP=(NEW,CATLG,DELETE) means 'create it, catalog it if the step ends normally, delete it if the step abends' — showing you understand DISP as a contract for both success and failure paths, not just a syntax detail.