Producing Printed Reports
10.9 Report Writer Examples
Example 10–8 (Cont.) Sample Program EX1008
MAIN SECTION.
000-DO-SORT.
SORT SORT-FILE ON ASCENDING KEY SORT-NAME
WITH DUPLICATES IN ORDER
USING CUSTOMER-FILE
GIVING SORTED-FILE.
000-START.
DISPLAY "*** EX1008 ***".
DISPLAY "Enter Current Date (YYYYMMDD) :".
ACCEPT UNEDITED-DATE.
OPEN INPUT
SORTED-FILE.
OPEN OUTPUT PRINTER-FILE.
MOVE SPACES TO NAME.
INITIATE MASTER-LIST.
PERFORM 200-READ-MASTER UNTIL EOF = "Y".
100-END-OF-FILE.
TERMINATE MASTER-LIST.
CLOSE SORTED-FILE, PRINTER-FILE.
STOP RUN.
200-READ-MASTER.
READ SORTED-FILE AT END MOVE "Y" TO EOF
MOVE HIGH-VALUES TO SORTED-NAME.
GENERATE DETAIL-LINE.
IF SORTED-NAME NOT = NAME
MOVE S-INVOICE-SALES TO SAVE-INVOICE-SALES.
IF EOF NOT = "Y"
MOVE SORTED-RECORD TO CUSTOMER-MASTER-RECORD.
10–64 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: ......