Compaq AAQ2G1FTK Marine Radio User Manual


 
Producing Printed Reports
10.6 Programming a Linage-File Compaq COBOL Report
For example, to define how many lines you want your program to skip at the
top or bottom of the logical page, use the LINAGE clause with either the LINES
AT TOP or the LINES AT BOTTOM phrase. To define a footing area within the
logical page, use the LINAGE clause with the WITH FOOTING phrase.
The LINES AT TOP phrase positions the printer on the first print line in the page
body. The LINES AT BOTTOM phrase positions the printer at the top of the next
logical page once the current page body is complete. The WITH FOOTING phrase
defines a footing area in the logical page that controls page-overflow conditions.
Additionally, you can insert specific text, such as footnotes or page numbers, on
the bottom lines of your logical page.
In addition to defining the logical page area and the number of lines that appear
on a page, you must be prepared to handle vertical spacing, horizontal spacing,
logical page advancement, and page-overflow. The following sections discuss these
topics in detail.
10.6.2 Controlling the Spacing in a Linage-File Report
To control the horizontal spacing on a logical page, define every report item from
your report layout worksheet in the Working-Storage Section of your Compaq
COBOL program.
To control the vertical spacing on a logical page, use the WRITE statement. The
WRITE statement controls whether one or more lines is skipped before or after
your program writes a line of the report. For example, to print a line before
advancing five lines, use the following:
WRITE... BEFORE ADVANCING 5 LINES.
To print a line after advancing two lines, use the following:
WRITE... AFTER ADVANCING 2 LINES.
10.6.3 Using the LINAGE-COUNTER
The LINAGE-COUNTER special register is one method of tracking the number
of lines that your program writes on a logical page. When you use the LINAGE-
COUNTER special register, each time a line is written or skipped, the register is
incremented by 1.
Before the program writes a new line, it checks the LINAGE-COUNTER value
to see if the current logical page can accept the new line. If the value equals the
maximum number of lines for the page body, the compiler positions the pointer on
the first print line of the next page body. The compiler automatically resets this
register to 1 each time your program begins a new logical page.
If you choose not to use the LINAGE-COUNTER register, you can advance to the
next logical page using the WRITE statement, as explained in Section 10.6.4.
10.6.4 Advancing to the Next Logical Page in a Linage-File Report
Linage-files automatically advance to the next logical page when the LINAGE-
COUNTER value equals the number of lines on the logical page. However,
Compaq COBOL also lets your program control logical page advancement with
the WRITE statement.
To manually advance to the next logical page from any line in the current
page body and position the printer on the first print line of the next page body,
your program must include the WRITE statement with either the BEFORE
1014 Producing Printed Reports