LINAGE-COUNTER Special Register
A separate LINAGE-COUNTER special register is generated for each FD entry containing a LINAGE clause (when more than one is generated, you must qualify each LINAGE-COUNTER with its related file-name).
- If the LINAGE clause specifies data-name-3, LINAGE-COUNTER has the same PICTURE and USAGE as data-name-3.
- If the LINAGE clause specifies integer-8, LINAGE-COUNTER is a binary item large enough to hold the binary representation of integer-8.
The value in LINAGE-COUNTER at any given time is the line number at which the device is positioned within the current page. LINAGE-COUNTER may be referred to in Procedure Division statements; it cannot be modified by them.
LINAGE-COUNTER is initialized to 1 when an OPEN statement for this file is executed.
LINAGE-COUNTER is automatically modified by any WRITE statement for this file. (See WRITE Statement.)
If the file description for a sequential file contains the LINAGE clause and the EXTERNAL clause, the LINAGE-COUNTER data item is an external data item. Similarly, if it contains the LINAGE and GLOBAL clauses, the LINAGE-COUNTER data item is a global data item.
You can specify the LINAGE-COUNTER special register wherever an integer argument to a function is allowed.