COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-27
File Description Entries
assume that the printer is positioned at the first line, omit the page eject, and
advance the printer by top lines.
Examples:
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.
Value
of top Page-Eject Issued?
Lines Skipped
Additional Total
0No 0 0
1No 1 1
2No 2 2
3 Yes (skips 3) 0 3
4 Yes (skips 3) 1 4
5 Yes (skips 3) 2 5
6 Yes (skips 3) 3 6