Modernization Hub

Data Definition (DD) Statement

Enhanced Definition

A Data Definition (DD) statement is a fundamental Job Control Language (JCL) statement used in IBM z/OS to define and allocate input/output resources for a job step. It associates a symbolic name (DDNAME) with a specific physical dataset, device, or other I/O resource, enabling programs to access data without needing to know the physical characteristics of the resource.

Key Characteristics

    • Syntax: A DD statement begins with //ddname DD followed by various parameters that describe the resource. The ddname is a symbolic name (1-8 characters) referenced by the application program.
    • Resource Allocation: It specifies the type of I/O resource (e.g., sequential dataset, VSAM dataset, PDS/PDSE member, tape volume, printer, terminal) and its attributes.
    • Scope: DD statements are typically defined within a specific job step (EXEC statement) and are active only for the duration of that step. They can also be defined at the job level (JOB statement) for global scope.
    • Parameters: Common parameters include DSN (dataset name), DISP (disposition), UNIT (device type), VOL (volume serial), SPACE (allocation for new datasets), DCB (data control block attributes), SYSOUT (spooled output), PATH (for z/OS UNIX files), and INSTREAM (for inline data).
    • Dynamic Allocation: While traditionally defined in JCL, resources can also be dynamically allocated by programs using SVC 99 or TSO ALLOCATE commands, which effectively create DD statements in memory.

Use Cases

    • Program Input/Output: Defining input files for a COBOL program (e.g., //INFILE DD DSN=PROD.INPUT.DATA,DISP=SHR) and output files (e.g., //OUTFILE DD DSN=PROD.OUTPUT.REPORT,DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(10,5))).
    • Temporary Work Files: Allocating temporary datasets for intermediate processing within a job step using DSN=&&TEMPDSN or DSN=&SYSUT1 (for utilities).
    • Spooling Output: Directing program output to the system spool for printing or viewing using SYSOUT=* or SYSOUT=(A,INTRDR).
    • Utility Program Resources: Specifying input and output datasets for z/OS utility programs like IEBGENER, IDCAMS, or DFSORT.
    • In-stream Data: Providing small amounts of input data directly within the JCL stream using DD * or DD DATA.

Related Concepts

DD statements are integral to JCL (Job Control Language), serving as the primary mechanism to bridge application programs with external data resources. A COBOL program's SELECT...ASSIGN TO ddname clause directly refers to a DD statement's ddname, allowing the program to perform I/O operations without knowing the physical dataset details. The z/OS operating system uses the information in DD statements to allocate physical devices and datasets, manage access, and enforce security. They work in conjunction with datasets (sequential, PDS/PDSE, VSAM) and catalogs (VSAM, ICF) by providing the dataset name, which the system then uses to locate the dataset's attributes and physical location.

Best Practices:
  • Meaningful DDNAMEs: Use descriptive ddnames that clearly indicate the purpose of the dataset (e.g., INFILE, OUTRPT, SYSPRINT).
  • Cataloged Datasets: For permanent datasets, always catalog them (DISP=(NEW,CATLG)) and omit UNIT and VOL parameters in subsequent DD statements to allow the system to locate them efficiently.
  • Temporary Datasets: Use DSN=&&TEMPDSN for temporary datasets that are deleted at job end, or DSN=&SYSUT1 for standard utility work files.
  • Disposition (DISP): Carefully specify DISP parameters (e.g., (NEW,CATLG,DELETE), (OLD,KEEP), (MOD,PASS)) to ensure correct dataset creation, retention, and sharing, preventing data loss or integrity issues.
  • FREE=CLOSE: For datasets that might be shared or need to be released before the step ends (e.g., tape drives, specific DASD volumes), use FREE=CLOSE to deallocate the resource immediately after the dataset is closed by the program.

Related Vendors

ASE

3 products

IBM

646 products

Applied Software

7 products

Tone Software

14 products

Trax Softworks

3 products

Related Categories

Operating System

154 products

Encryption

41 products

Files and Datasets

168 products

Automation

222 products

Browse and Edit

64 products