Compaq COBOL AAQ2G1FTK User Manual
Page 317
Producing Printed Reports
10.6 Programming a Linage-File Compaq COBOL Report
Example 10–4 (Cont.) Checking for End-of-Page on a 28-Line Logical Page
DATA DIVISION.
FILE SECTION.
FD
INPUT-FILE.
01
INPUT-RECORD.
02
I-NAME.
03
I-FIRST
PIC X(10).
03
I-MID
PIC X.
03
I-LAST
PIC X(15).
02
I-ADDRESS.
03
I-STREET
PIC X(20).
03
I-CITY
PIC X(15).
03
I-STATE
PIC XX.
03
I-ZIP
PIC 99999.
02
I-ACCOUNT-NUMBER
PIC X(9).
02
I-PURCHASE-DATE
PIC XXXXXX.
02
I-PURCHASE-AMOUNT
PIC S9(6)V99.
02
I-PURCHASE-DESCRIP
PIC X(20).
FD
REPORT-FILE
LINAGE IS 26 LINES
WITH FOOTING AT 25
LINES AT BOTTOM
2.
01
PRINT-LINE
PIC X(80).
WORKING-STORAGE SECTION.
01
HEAD-1.
02
H1-LC
PIC 99.
02
FILLER
PIC X(20) VALUE "XYZ Clothing Store
".
02
FILLER
PIC X(25) VALUE SPACES.
02
FILLER
PIC X(6)
VALUE "Page: ".
02
H1-PAGE
PIC Z(9).
01
HEAD-2.
02
H2-LC
PIC 99.
02
FILLER
PIC X(20) VALUE "STATEMENT OF ACCOUNT".
02
FILLER
PIC X(25) VALUE SPACES.
02
FILLER
PIC X(6)
VALUE "Date: ".
02
H2-DATE
PIC X(9).
01
HEAD-3.
02
H3-LC
PIC 99.
02
FILLER
PIC X(6)
VALUE "Name: ".
02
H3-FNAME PIC X(10).
02
FILLER
PIC X
VALUE SPACE.
02
H3-MNAME PIC X.
02
FILLER
PIC X
VALUE SPACE.
02
H3-LNAME PIC X(15).
02
FILLER
PIC X(17) VALUE " Account Number: ".
02
H3-NUM
PIC Z(9).
01
HEAD-4.
02
H4-LC
PIC 99.
02
FILLER
PIC X(9)
VALUE "Address: ".
02
H4-STRT
PIC X(20).
02
FILLER
PIC X
VALUE SPACE.
02
H4-CITY
PIC X(15).
02
FILLER
PIC X
VALUE SPACE.
02
H4-STATE PIC XX.
02
FILLER
PIC X
VALUE SPACE.
02
H4-ZIP
PIC 99999.
(continued on next page)
Producing Printed Reports 10–17