Example 10–4 (Cont.) Checking for End-of-Page on a 28-Line Logical Page
A300-PRINT-DETAIL-LINE.
MOVE I-PURCHASE-DATE
MOVE I-PURCHASE-AMOUNT TO DL-AMT.
MOVE I-PURCHASE-DESCRIP TO DL-DESC.
* At EOP this last detail line goes in footing area of current page
WRITE PRINT-LINE FROM DETAIL-LINE
ADD I-PURCHASE-AMOUNT TO TOTAL-PURCHASES.
A400-PRINT-TOTALS.
MOVE TOTAL-PURCHASES TO TL.
* Skip to footing area
COMPUTE THESE-MANY = 25 - LINAGE-COUNTER.
WRITE PRINT-LINE FROM TOTAL-LINE AFTER ADVANCING THESE-MANY LINES.
MOVE 0 TO TOTAL-PURCHASES.
A500-PRINT-HEADERS.
ADD 1 TO PAGE-NUMBER.
MOVE PAGE-NUMBER TO H1-PAGE.
WRITE PRINT-LINE FROM HEAD-1 AFTER ADVANCING PAGE.
WRITE PRINT-LINE FROM HEAD-2.
MOVE SPACES TO PRINT-LINE.
WRITE PRINT-LINE.
WRITE PRINT-LINE FROM HEAD-3.
WRITE PRINT-LINE FROM HEAD-4.
WRITE PRINT-LINE FROM HEAD-5.
WRITE PRINT-LINE FROM HEAD-6.
A600-SET-UP-HEADERS.
MOVE I-FIRST
MOVE I-MID
MOVE I-LAST
MOVE I-ACCOUNT-NUMBER TO H3-NUM.
MOVE I-STREET
MOVE I-CITY
MOVE I-STATE
MOVE I-ZIP
10.6.6 Printing a Linage-File Report
The default PRINT command inserts a page ejection when a form nears the end
of a page. Therefore, when the default PRINT command refers to a linage-file
report, it can change the report's page spacing.
On Tru64 UNIX systems, to print a linage-file report, use this command:
% lpr report-file-specification
On OpenVMS Alpha systems, to print a linage-file report, use the /NOFEED
qualifier with the DCL PRINT command as follows:
$ PRINT report-file-specification/NOFEED
On OpenVMS Alpha systems, the LINAGE clause causes a Compaq COBOL
report file to be in print-file format. (See Chapter 6 for more information.)
When a WRITE statement positions the file to the top of the next logical page,
the device is positioned by line spacing rather than by page ejection or form feed.
For more information on printing your report, see Section 10.7.
10.6 Programming a Linage-File Compaq COBOL Report
TO DL-DATE.
AT END-OF-PAGE PERFORM A500-PRINT-HEADERS.
TO H3-FNAME.
TO H3-MNAME.
TO H3-LNAME.
TO H4-STRT.
TO H4-CITY.
TO H4-STATE.
TO H4-ZIP.
Producing Printed Reports
Producing Printed Reports 10–19
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?
Questions and answers