Figure 10–17 EX1008.LIS Listing
CUSTOMER MASTER FILE REPORT
+--------------------------------------------------------------------------------------------------------------+
|
NAME
|
|--------------------------------------------------------------------------------------------------------------|
| LAST
| FIRST
|MI|
+--------------------------------------------------------------------------------------------------------------+
Abbott
John
B 12 Pleasant Street
Adam
Harold
B 980 Main Street
Albert
Robert
S 100 Meadow Lane
Alexander
Greg
T 317 Narrows Road
Allan
David
L 10 Wonder Lane
Alwin
Tom
F 400 High Street
Ames
Alice
J 40 Center Road
Amico
Art
A 31 Athens Road
Amos
James
A 71 State Rd
Berger
Tom
H 700 McDonald Lane
Carroll
Alice
L 192 Lewis Road
Carter
Winston
R 123 Timpany Street
Cooper
Frank
J 300 Mohican Avenue
Dickens
Arnold
C 100 Bleak Street
Dickinson
Rose
E 21 Depot Road
Frost
Alfred
R 123 Amherst Street
Hemingway
Joe
E 10 Cuba Street
Thoreaux
Ralph
H 800 Emerson Street
Williams
Samuel
A 310 England Road
10.9.5 EX1009—Detail Report Program
Example 10–9 (EX1009) is a Report Writer program that uses the REPORT
HEADING, PAGE HEADING, DETAIL, PAGE FOOTING, CONTROL FOOTING,
and REPORT FOOTING report groups. The program also uses the TYPE
DETAIL clause—GROUP INDICATE. The program produces a detail report—
EX1009.LIS (shown in Figure 10–18).
Example 10–9 Sample Program EX1009
IDENTIFICATION DIVISION.
PROGRAM-ID. EX1009.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CUSTOMER-FILE ASSIGN TO "MASTER.DAT".
SELECT SORT-FILE
SELECT SORTED-FILE
SELECT PRINTER-FILE ASSIGN TO "EX1009.LIS".
*******************************
*
*
Customer Master File
*
*
11-08-2000
*
*
Report EX1008
*
Detail Report
*
*
*******************************
ADDRESS
STREET
|
CITY
Nashua
Nashua
Gardner
East Westminster
Merrimack
Princeton
Nashua
Nashua
East Westminster
Merrimack
London
Brookline
Mohawk
Gardner
Amherst
Merrimack
Westminster
Walden
Worcester
*******************************
*
*
Customer Master File
*
*
11-08-2000
*
*
End of Report EX1008
*
*******************************
ASSIGN TO "EX1009-SORTIN.TMP".
ASSIGN TO "EX1009-SORTOUT.TMP".
Producing Printed Reports
10.9 Report Writer Examples
*
*
*
*
*
*
*
*
*
|
INVOICE
|ST| ZIP
| DATE
| NUMBER|
AMOUNT
NH 03102
7-01-2000 000001
$70,006.30
NH 03102
2-06-2000 000002
$21,008.90
MA 01420
2-06-2000 000003
$61,009.00
MA 01473
2-06-2000 000004
$60,004.26
NH 03014
2-06-2000 000001
$24,101.00
NJ 12341
3-07-2000 000008
$70,000.17
NH 03060
2-07-2000 000007
$30,000.00
NH 03060
2-06-2000 000007
$12,340.70
MA 01473
2-06-2000 000006
$41,000.90
NH 03060
2-06-2000 000010
$12,341.60
NH 03416
2-07-2000 000012
$16,789.00
NH 03078
2-07-2000 000011
$23,416.76
MA 01480
2-07-2000 000014
$34,167.80
MA 01440
2-07-2000 000011
$12,341.67
MA 01423
2-07-2000 000019
$66,688.90
NH 03060
2-07-2000 000020
$11,114.90
MA 01473
2-07-2000 000013
$87,690.00
MA 01416
2-07-2000 000016
MA 01400
2-07-2000 000017
$78,900.00
*******************************************
*
GRAND TOTAL INVOICES:
$732,927.86
*******************************************
*
*
*
*
*
*
*
VM-0662A-AI
Producing Printed Reports 10–65
PAGE
2
|
|
$6.00
*
(continued on next page)
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?