DD Card - Data Definition card
A DD (Data Definition) card is a Job Control Language (JCL) statement used to define and describe data sets or other I/O resources required by a program within a specific job step on IBM z/OS. It acts as the crucial link between a program's logical file name (DDNAME) and the physical characteristics and location of the data or device it will access. A DD (Data Definition) card is a fundamental JCL (Job Control Language) statement in IBM z/OS that defines the characteristics and location of data sets or other I/O resources required by a program executing within a job step. It serves as the crucial link between a program's logical file name and the physical data set or device.
Key Characteristics
-
- JCL Statement: It is a fundamental statement within JCL, following an
EXECstatement and preceding other DD statements or the nextEXECstatement. - Syntax: The general format is
//ddname DD parameters, whereddnameis the logical name referenced by the application program. - Resource Specification: Defines various I/O resources, including sequential data sets, VSAM data sets, PDS/PDSE members, temporary data sets, in-stream data, and SYSOUT (printer/spool output).
- Parameters: Utilizes a wide array of parameters like
DSN(data set name),DISP(disposition),UNIT(device type),VOL(volume serial),SPACE(allocation),DCB(data control block attributes),SYSOUT(output class),PATH(for USS files), etc. - Scope: The definitions provided by a DD card are valid only for the specific job step in which they are declared.
- Dynamic Allocation: While traditionally static in JCL, DD cards can also be dynamically allocated by programs using SVC 99 (DYNALLOC) or through utility programs.
- JCL Statement: It is a fundamental statement within JCL, following an
Use Cases
-
- Allocating New Data Sets: Creating a new sequential or partitioned data set for program output, specifying its size, record format, and block size.
- Referencing Existing Data Sets: Providing an application program access to an existing VSAM KSDS, sequential file, or PDS member for input or update.
- Directing Output to Spool: Sending program reports or log files to the z/OS spool for printing or viewing, typically using
SYSOUT=*or a specificSYSOUTclass. - Providing In-Stream Data: Supplying small amounts of input data directly within the JCL stream itself using
DD *orDD DATA. - Defining Temporary Work Files: Creating temporary data sets for intermediate processing within a job step, which are automatically deleted at the end of the step or job.
Related Concepts
DD cards are intrinsically linked to JCL as they are the primary mechanism for resource allocation within a job step defined by an EXEC statement. They bridge the gap between application programs (e.g., COBOL, PL/I, Assembler) that refer to logical file names (DDNAMEs) and the actual data sets or devices on the z/OS system. The parameters on a DD card directly influence the DCB (Data Control Block) information used by the operating system and access methods to manage I/O operations for the associated data set.
- Meaningful DDNAMEs: Use descriptive
ddnames that clearly indicate the purpose of the data set (e.g.,INFILE,OUTRPT,WORK01). - Correct
DISPParameter: Always specify the appropriateDISP(Disposition) parameter (NEW,OLD,SHR,MOD) to correctly manage data set creation, access, and deletion, preventing data loss or integrity issues. - Temporary Data Sets: Utilize
DSN=&&tempnamefor temporary data sets that are only needed for the duration of the job, ensuring they are automatically deleted. - Cataloged Data Sets: For cataloged data sets, omit
UNITandVOLparameters where possible, relying on the system catalog for location information to improve portability and reduce maintenance. DCBAttributes: Explicitly defineDCBattributes (LRECL,BLKSIZE,RECFM) on the DD card when creating new data sets, or ensure they are consistent with existing data sets or program expectations.