Data Control Block
A Data Control Block is a description of a dataset in IBM mainframe operating systems, such as OS/360, MVS, and z/OS. A DCB is coded in Assembler programs using the DCB macro instruction. High-level language programmers use library routines containing DCBs.
A DCB is one of many control blocks used in these operating systems. A control block is a data area with a predefined structure, very similar to a C
struct, but typically only related to system functions. A DCB may be compared to a FILE structure in C, but it is much more complex, offering many more options for access methods.The control block acted as the Application programming interface between Logical IOCS and the application program and usually was defined within the application program. The addresses of I/O subroutines were resolved during a linkedit phase after compilation or else dynamically inserted at OPEN time.
The equivalent control block for IBM DOS/360, DOS/VSE and z/VSE operating systems is a "DTF"
Typical contents
- symbolic file name
- type of access
- physical characteristics
- number of I/O buffers to allocate for processing to permit overlap of I/O
- address of I/O operating system library subroutines
- other variables as required by the subroutines according to type
Prototype DCBs
The OPEN process merges the constants and variables specified in the DD JCL statement, and the dataset label for existing magnetic tape and direct-access datasets, into the DCB, replacing zero values with non-zero values.
A control block called the Job File Control Block initially holds the information extracted from the DD statement for the dataset. The results of the merge are stored in the JFCB which may also be written into the DSCB during the CLOSE process, thereby making the dataset definition permanent.
An example is the BLKSIZE= variable, which usually is specified in the DCB as zero. In the DD statement, the BLKSIZE is specified as a non-zero value and this results in a program-specified LRECL and a JCL-specified BLKSIZE, with the merge of the two becoming the permanent definition of the dataset.