Data Control Block
| Company type | System data structure |
|---|---|
| Industry | Computer software, IBM mainframe operating systems |
| Products | Dataset representation within applications on IBM mainframes |
In IBM mainframe operating systems such as OS/360, MVS, and z/OS, a Data Control Block (DCB) represents a dataset within an application. Programmers write DCBs in Assembler utilizing the DCB macro, which expands into several "define constant" instructions; meanwhile, those coding in higher-level languages interact with DCBs through library routines.
A DCB is classified as a control block, a structured data segment akin to a C struct, but specifically designed to handle system-level operations. It functions as a bridge between Logical IOCS and user programs, analogous to the FILE structure in C but with enhanced complexity to accommodate multiple access methods.
Typically, DCBs are embedded within the application, with the linking of I/O subroutine addresses resolved either at link time or dynamically during the OPEN operation. In IBM DOS/360, DOS/VSE, and z/VSE environments, the comparable control block is referred to as "DTF" (Define the file).
Typical contents of a DCB
- Symbolic dataset name corresponding to a JCL OPEN statement
- Access mode (such as random, sequential, or indexed)
- Physical attributes (blocksize, logical record length)
- Quantity of I/O buffers allocated for concurrent processing
- Pointers to I/O operating system library routines (e.g., read and write operations)
- Additional variables required by these subroutines
Prototype DCBs
Many constants and variables within a DCB are initially set to zero and finalized during the OPEN procedure by integrating values from the DD JCL statement along with dataset labels. This integration updates the Job File Control Block (JFCB), which consolidates definitions and may record them into the DSCB upon CLOSE, thereby establishing permanent dataset parameters.
For instance, BLKSIZE is frequently zero within the DCB but assigned a non-zero value in JCL; this combination defines both the logical record length used by the program and the physical block size specified in JCL, solidifying the dataset’s permanent attributes.
See also
- Data Set Control Block (DSCB), found within VTOC
- Record-oriented filesystem