Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Record formats

DMS supports three different record formats:

Record format F

with records of fixed length

Record format V

with records of variable length (default format)

Record format U

with records of undefined length

Format F (fixed-length records)

A file has the attribute “fixed-length records” if it is created with the operand RECORD-FORMAT=*FIXED in the ADD-FILE-LINK command or with the corresponding specification in a program. The record length must be defined via the RECORD-SIZE operand.

All records of the file have the same length, which is stored in the file's catalog entry. Since the system already knows the record length, the user does not have to worry about a record length or control field (see below) for input and output.

Format V (variable-length records)

RL: record length = length of data area + 4

A file has the attribute “variable-length records” if it is created with the operand RECORD-FORMAT=*VARIABLE in the ADD-FILE-LINK command; RECORD-FORMAT=*VARIABLE is the default value if no record format is specified.

In variable-length records, there is always a 4-byte control field in front of the actual data, and the first two bytes of this field contain, in binary form, the length of the record, including the control field. The other two bytes of the field are reserved.

Format U (undefined-length records)

A file consists of “undefined-length records” if it is created with the operand RECORD-FORMAT=*UNDEFINED in the ADD-FILE-LINK command.

A file with record format U contains precisely one record per data block. Therefore, the current record length, which, when writing, the user has to always specify in a general-purpose register, is the same as the block length. Because BS2000 automatically stores the block length outside of the data area in the block-specific management information (see for example the section "Block formats for disk files"), it is not necessary to save the record length separately. Therefore, as with fixed record lengths, the user does not have to worry about record length or control fields: A record only contains the net data.