ILE COBOL Language Reference

RECORD clause - Format 2

Format 2 is the recommended format when dealing with variable records.

RECORD Clause - Format 2
 
>>-RECORD--+----+--VARYING--+----+--+------+-------------------->
           '-IS-'           '-IN-'  '-SIZE-'
 
>--+---------------------+--+---------------+--+------------+--->
   '-+------+--integer-4-'  '-TO--integer-5-'  '-CHARACTERS-'
     '-FROM-'
 
>--+--------------------------------+--------------------------><
   '-DEPENDING--+----+--data-name-1-'
                '-ON-'
 
 
integer-4
Specifies the minimum number of character positions to be contained in any record of the file. If integer-4 is not specified, the minimum number of character positions to be contained in any record of the file is equal to the smallest number of character positions described for a record in that file. If specified, integer-4 must be nonzero and less than integer-5.
integer-5
Specifies the maximum number of character positions in any record of the file. If integer-5 is not specified, the maximum number of character positions in any record of the file is equal to the greatest number of character positions described for a record in that file.
data-name-1
Must be an elementary unsigned integer.

If data-name-1 is specified:

The number of character positions associated with a record description is determined by the sum of the number of character positions in all elementary data items (excluding redefinitions and renamings), plus any implicit FILLER due to synchronization.

If a table is specified, the minimum and maximum number of table elements described in the record are used in the summation above, to determine the minimum and maximum number of character positions associated with the record description.

If the number of character positions in the logical record to be written is less than integer-4 or greater than integer-5, the output statement is unsuccessful and, except during execution of a RELEASE statement, the associated I-O status key is set to a value indicating the cause of the condition.

During the execution of a RELEASE, REWRITE, or WRITE statement, the number of character positions in the record is determined by the following conditions:

During the execution of a READ ... INTO or RETURN ... INTO statement, the number of character positions in the current record that participate as the sending data items in the implicit MOVE statement is determined by the following conditions:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]