COBOL Manual for TNS and TNS/R Programs
Data Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
7-28
File Description Entries
•
Effect of body, foot, top, and bottom
The description of the first logical page is determined from top, body, foot, and
bottom when the file is opened by an OPEN statement with the OUTPUT phrase.
If literals are used to define all these page areas, all logical pages have the same
layout.
If one or more of the values are data-names, then each time a WRITE statement
with the ADVANCING PAGE phrase is executed or a page overflow occurs, the
current value of the data-names is used to set up the next logical page.
•
Printing Device Does Not Space
Each logical page continues to the next with no additional spacing from the printing
device.
•
The LINAGE-COUNTER Special Register
Every file description that has a LINAGE clause generates a special register called
LINAGE-COUNTER. At any given time, LINAGE-COUNTER contains the value of
the current line number within the current page body.
A LINAGE-COUNTER can be read but not modified.
If more than one file description contains a LINAGE clause, each reference to a
LINAGE-COUNTER must be qualified by its file name.
The value of LINAGE-COUNTER is automatically set to 1 when its file is opened.
During execution of a WRITE statement to its file, LINAGE-COUNTER is
automatically modified under these conditions:
°
When the ADVANCING PAGE phrase of a WRITE statement is encountered,
LINAGE-COUNTER is reset to 1.
°
When the ADVANCING phrase is specified in a WRITE statement, LINAGE-
COUNTER is increased by the number of lines given.
°
When the ADVANCING phrase of the WRITE statement is not used, LINAGE-
COUNTER is increased by 1.
°
When execution of a WRITE statement repositions the file to the first line in the
page body of the next logical page, LINAGE-COUNTER is reset to 1.
If the file description entry containing the LINAGE clause includes the EXTERNAL
clause as well, the file then has the external attribute. In this case, the LINAGE-
COUNTER special register is also an external data item. Execution of a WRITE
statement for such a file by any programs that share access to the file modifies the
same unique special register.