Multiple choice technology mainframe

For variable length records the record length must be specified at the

  1. last 2 bytes of the record

  2. First 2 bytes of the records

  3. 3rd and 4th bytes of the record

  4. The record length will not be specified in the record

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

For variable-length records in file systems and data structures, the record length is typically stored at the beginning of the record (first 2 bytes) so the system knows how much data to read. This is a common pattern in binary file formats. Storing it at the end or middle would make it inefficient to locate.

AI explanation

For variable-length records in mainframe file formats (e.g. COBOL RECFM=V/VB), each record is prefixed with a Record Descriptor Word (RDW). The RDW occupies the first 4 bytes of the record, and it's specifically the first 2 bytes of that RDW that hold the binary record length; the next 2 bytes are reserved/flags. So the length is specified at the first 2 bytes of the record, matching the correct answer. It's not at the end, not at bytes 3-4, and it is always present for V-format records, ruling out the other options.