COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
If the ASSIGN clause specifies $RECEIVE, the value of length-max has an upper limit of
2,097,152 bytes (2MB). Otherwise, the upper limit is 32,767 bytes.
No record description entry for the file described with length-max can specify a number
of character positions greater than the value of length-max.
VARYING phrase
explicitly declares that the file consists of variable-length records (records of different sizes).
length-min
is as defined previously. The default is the size of the shortest record description entry.
length-max
is as defined previously. The default is the size of the longest record description entry.
length-var
is the data-name of an unsigned integer numeric data item. It tells the REWRITE and WRITE
statements how many characters to deliver, and receives the size (in characters) of any
record that was read successfully. It can be qualified, but not subscripted or
reference-modified.
Record size is the actual number of bytes needed to store the record, determined by the sum of
bytes for each fixed-length elementary item plus the maximum number of bytes for any variable-length
item. The number of bytes for an item also depends on its USAGE clause, and if synchronization
is active, any filler from alignment on storage boundaries.
Usage Considerations:
• Describing Fixed-Length Records
The RECORD CONTAINS length-fixed CHARACTERS form specifies that the file consists
of fixed-length records. Both other forms specify that the file consists of variable-length records.
If the record you write is smaller than the fixed length, the extra characters are undefined.
If you declare a file for a terminal, you must specify variable-length records, or else each
record entered must be exactly the same length.
• Defaulting to Fixed-Length Records
If no RECORD clause is present, the compiler declares the file to consist of fixed-length records.
In this case, the record length is the size of the associated record description entry specifying
the greatest number of character positions.
• File With Fixed-Length Records Can Hold Records of Shorter Lengths
If you describe a file as having fixed-length records, each record description for that file’s
record area can describe a record of any length from 1 up to the stated fixed length.
File Section 165










