Producing Printed Reports
10.6 Programming a Linage-File Compaq COBOL Report
Example 10–5 Programming a 20-Line Logical Page Defined by the LINAGE
Clause with Automatic Page Overflow
IDENTIFICATION DIVISION.
PROGRAM-ID. REPLINAG.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPUT-FILE
ASSIGN TO "REPIN.DAT".
SELECT MINIF1-REPORT ASSIGN TO "MINIF1.DAT".
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.
FD
MINIF1-REPORT
LINAGE IS 13 LINES
LINES AT TOP
2
LINES AT BOTTOM 5.
01
MINIF1-PRINT-LINE
PIC X(80).
WORKING-STORAGE SECTION.
01
END-OF-FILE
PIC
X
VALUE SPACE.
01
LINE-UP-OK
PIC
X
VALUE SPACE.
01
MINIF1-LINE-3.
02
FILLER
PIC X(9)
VALUE SPACES.
02
MINIF1-LAST
PIC X(15).
02
FILLER
PIC X(23)
VALUE SPACES.
02
FILLER
PIC X(6)
VALUE "Date: ".
02
MINIF1-DATE
PIC 99/99/99.
01
MINIF1-LINE-13.
02
FILLER
PIC X(4)
VALUE SPACES.
02
MINIF1-NAME
PIC X(26).
01
MINIF1-LINE-14.
02
FILLER
PIC X(4)
VALUE SPACES.
02
MINIF1-STREET
PIC X(20).
01
MINIF1-LINE-15.
02
FILLER
PIC X(4)
VALUE SPACES.
02
MINIF1-CITY
PIC X(15).
02
FILLER
PIC X
VALUE SPACE.
02
MINIF1-STATE
PIC XX.
02
FILLER
PIC X
VALUE SPACE.
02
MINIF1-ZIP
PIC 99999.
PROCEDURE DIVISION.
A000-BEGIN.
OPEN OUTPUT MINIF1-REPORT.
ACCEPT MINIF1-DATE FROM DATE.
PERFORM A300-FORM-LINE-UP UNTIL LINE-UP-OK = "Y".
OPEN INPUT
INPUT-FILE.
PERFORM A100-READ-INPUT UNTIL END-OF-FILE = "Y".
A010-WRAP-UP.
CLOSE INPUT-FILE
MINIF1-REPORT.
DISPLAY "END OF JOB".
STOP RUN.
(continued on next page)
10–22 Producing Printed Reports
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......