Format 3
Format 3 is used to specify variable-length records.
- integer-6
- Specifies the minimum number of bytes to be contained in any record of the file. If integer-6 is not specified, the minimum number of bytes to be contained in any record of the file is equal to the least number of bytes described for a record in that file.
- integer-7
- Specifies the maximum number of bytes in any record of the file. If integer-7 is not specified, the maximum number of bytes to be contained in any record of the file is equal to the greatest number of bytes described for a record in that file.
The number of bytes associated with a record description is determined by the sum of the number of bytes in all elementary data items (excluding redefinitions and renamings), plus any implicit FILLER due to synchronization. If a table is specified:
- The minimum number of table elements described in the record is used in the summation above to determine the minimum number of bytes associated with the record description.
- The maximum number of table elements described in the record is used in the summation above to determine the maximum number of bytes associated with the record description.
If data-name-1 is specified:
- data-name-1 must be an elementary unsigned integer.
- data-name-1 cannot be a windowed date field.
- The number of bytes in the record must be placed into the data item referenced by data-name-1 before any RELEASE, REWRITE, or WRITE statement is executed for the file.
- The execution of a DELETE, RELEASE, REWRITE, START, or WRITE statement or the unsuccessful execution of a READ or RETURN statement does not alter the content of the data item referenced by data-name-1.
- After the successful execution of a READ or RETURN statement for the file, the contents of the data item referenced by data-name-1 indicate the number of bytes in the record just read.
During the execution of a RELEASE, REWRITE, or WRITE statement, the number of bytes in the record is determined by the following conditions:
- If data-name-1 is specified, by the content of the data item referenced by data-name-1
- If data-name-1 is not specified and the record does not contain a variable occurrence data item, by the number of bytes positions in the record
- If data-name-1 is not specified and the record contains a variable occurrence data item, by the sum of the fixed position and that portion of the table described by the number of occurrences at the time of execution of the output statement
During the execution of a READ ... INTO or RETURN ... INTO statement, the number of bytes in the current record that participate as the sending data items in the implicit MOVE statement is determined by the following conditions:
- If data-name-1 is specified, by the content of the data item referenced by data-name-1
- If data-name-1 is not specified, by the value that would have been moved into the data item referenced by data-name-1 had data-name-1 been specified