Previous Topic: Field Type GA—Garbage Data (Permanently Unused Fields)

Next Topic: Field Types MA and MB—Pattern Matching


Field Type L—Insert Tally of Actual Length

This type is used to insert a binary length indicator at the front of each compressed record. When issued, it must be the first specification of the record definition statements. In the compressed record it appears as a 2-byte binary number at the start of the record after the RDW, if any, and before the type N fields. The type L field contains the number of bytes in the record that follows this field. It is coded in the record definitions simply as the letter L, with no length descriptor.

Type L is useful in reading and writing compressed records in COBOL. For example, the COBOL record definition (or redefinition) for records of maximum length 1000 can be specified as:

01 CMP-RCD SYNC.
   02 LEN PIC 9(4) COMP.
   02 CHARS PIC X OCCURS 1000 TIMES DEPENDING ON LEN.