RECORD clause

When the RECORD clause is used, the record size must be specified as the number of bytes needed to store the record internally, regardless of the USAGE of the data items contained within the record.

For example, if you have a record with 10 DBCS characters, the RECORD clause should say RECORD CONTAINS 20 CHARACTERS. For a record with 10 national characters, the RECORD clause should say the same, RECORD CONTAINS 20 CHARACTERS.

The size of a record is determined according to the rules for obtaining the size of a group item. (See USAGE clause  and SYNCHRONIZED clause.)

When the RECORD clause is omitted, the compiler determines the record lengths from the record descriptions. When one of the entries within a record description contains an OCCURS DEPENDING ON clause, the compiler uses the maximum value of the variable-length item to calculate the number of bytes needed to store the record internally.

If the associated file connector is an external file connector, all file description entries in the run unit that are associated with that file connector must specify the same maximum number of bytes.

The following sections describe the formats of the RECORD clause: