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).

The implicit description of LINAGE-COUNTER is one of the following:

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.