VLR
The VLR
option affects the file status
returned from READ
statements for variable-length
records when the length of record returned is inconsistent with the
record descriptions. It eases your migration from earlier versions
to Enterprise COBOL V6, if your programs have READ
statements
that result in a record length conflict.
- Default
VLR=STANDARD
After the execution of a
READ
statement:- If the number of character positions in the record that is read is less than the minimum size specified by the record description entries for the file, the portion of the record area that is to the right of the last valid character read is undefined.
- If the number of character positions in the record that is read is greater than the maximum size specified by the record description entries for the file, the record is truncated on the right to the maximum size.
In either of these cases, the READ
statement is
successful, and the file status is set to either 00
(hiding
the record length conflict condition) or 04
(indicating
that a record length conflict has occurred), depending on the VLR
compiler
option setting.
- COMPAT
- If you specify
VLR=COMPAT
, you get the status value of00
whenREAD
statements encounter a record length conflict. - STANDARD
- If you specify
VLR=STANDARD
, you get the status value of04
whenREAD
statements encounter a record length conflict.