COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Lines Skipped
TotalAdditionalPage-Eject Issued?Value of top
52Yes (skips 3)5
63Yes (skips 3)6
This logic applies only during initial positioning of the first logical page. The printer does not
perform page ejects for subsequent pages, and the value of top is not modified.
Handling the First Logical Page Specially
If you know that the printer file does not behave in the standard way, you can program around
the situation described in Initial Positioning of First Logical Page. In simple cases, follow these
steps:
1. In the LINAGE clause, specify a data item for top.
2. Initialize the data item with a value that produces the desired result for the first logical
page (see Initial Positioning of First Logical Page).
3. Open the output file.
4. Change the value of the data item to the value of the “real” top margin. (You can do this
even before the first WRITE statement.)
In more complex cases, follow these steps:
1. In the LINAGE clause, specify a data item for top.
2. Initialize the data item to 0.
3. Open the output file.
4. Use WRITE statements to position the first logical page properly.
5. Change the value of the data item to the value of the “real” top margin.
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.
File Section 171