RDW
Record descriptor word: four bytes at the start of each variable-length record that hold its length.
Also written record descriptor word, BDW, block descriptor word, RECFM=VB
Records in a variable-length dataset, with a record format such as VB, do not all have the same length. Each record starts with four extra bytes, the record descriptor word, or RDW, that say how long it is. The first two bytes hold the length, including the four RDW bytes themselves, and the other two are normally zero.
Each block of records also starts with a four-byte block descriptor word, or BDW, giving the block's length.
This explains a rule that surprises beginners: the LRECL of a variable-length dataset is the longest record's data plus four. A dataset with records of up to 200 bytes has an LRECL of 204.
Most programs never see the RDW. COBOL, for example, handles it for you, and the record area holds only the data. It matters when data leaves the mainframe. A file transfer can strip the RDWs, keep them, or turn them into line ends, and choosing the wrong option is a common reason a variable-length file arrives looking broken.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- Record formatWhether the records in a dataset are all the same length or vary, and how they are blocked. Written as RECFM.
- Logical record lengthHow long each record in a dataset is, in characters, written as LRECL.
- Block sizeHow much data is moved between disk and memory in one go, written as BLKSIZE.
- File transferMoving data between the mainframe and other systems, where character encoding and record structure both need attention.
- Sequential datasetThe simplest kind of dataset: records stored one after another and normally read from start to finish.