Compaq COBOL AAQ2G1FTK User Manual
Page 348
Producing Printed Reports
10.9 Report Writer Examples
Example 10–6 (Cont.) Sample Program EX1006
000-DO-SORT.
DISPLAY "*** EX1006 ***".
SORT SORT-FILE ON ASCENDING KEY SORT-NAME
WITH DUPLICATES IN ORDER
USING
CUSTOMER-FILE
GIVING SORTED-FILE.
DISPLAY "*** Created EX1006.LIS ***".
050-START.
OPEN INPUT
SORTED-FILE.
OPEN OUTPUT PRINTER-FILE.
ACCEPT UNEDITED-DATE FROM DATE.
INITIATE MASTER-LIST.
PERFORM 200-READ-MASTER UNTIL NAME = HIGH-VALUES.
TERMINATE MASTER-LIST.
CLOSE SORTED-FILE, PRINTER-FILE.
STOP RUN.
200-READ-MASTER.
READ SORTED-FILE AT END MOVE HIGH-VALUES TO NAME.
IF NAME NOT = HIGH-VALUES GENERATE DETAIL-LINE.
Figure 10–15 EX1006.LIS Listing
CUSTOMER MASTER FILE REPORT
PAGE 1
+--------------------------------------------------------------------------------------------------------------+
|
NAME
|
ADDRESS
|
INVOICE
|--------------------------------------------------------------------------------------------------------------|
| LAST
| FIRST
|MI|
STREET
|
CITY
|ST|
| DATE
| NUMBER|
AMOUNT
+--------------------------------------------------------------------------------------------------------------+
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Abbott
John
B 12 Pleasant Street
Nashua
NH 03102
7-01-2000 000001
$10,000.90
Adam
Harold
B 980 Main Street
Nashua
NH 03102
2-06-2000 000002
$21,008.90
Albert
Robert
S 100 Meadow Lane
Gardner
MA 01420
2-06-2000 000003
$61,009.00
Alexander
Greg
T 317 Narrows Road
Westminster
MA 01473
2-06-2000 000004
$10,000.71
Alexander
Greg
T 317 Narrows Road
Westminster
MA 01473
2-06-2000 000004
$10,000.71
Alexander
Greg
T 317 Narrows Road
Westminster
MA 01473
2-06-2000 000004
$10,000.71
Alexander
Greg
T 317 Narrows Road
East Westminster
MA 01473
2-06-2000 000004
$10,000.71
Alexander
Greg
T 317 Narrows Road
Westminster
MA 01473
2-06-2000 000004
$10,000.71
Alexander
Greg
T 317 Narrows Road
East Westminster
MA 01473
2-06-2000 000004
$10,000.71
Allan
David
L 10 Wonder Lane
Merrimack
NH 03014
2-06-2000 000001
$24,101.00
Alwin
Tom
F 400 High Street
Princeton
NJ 12341
3-07-2000 000008
$70,000.17
Ames
Alice
J 40 Center Road
Nashua
NH 03060
2-07-2000 000007
$10,000.00
Ames
Alice
J 40 Center Road
Nashua
NH 03060
2-07-2000 000007
$10,000.00
Ames
Alice
J 40 Center Road
Nashua
NH 03060
2-07-2000 000007
$10,000.00
Amico
Art
A 31 Athens Road
Nashua
NH 03060
2-06-2000 000007
$12,340.70
Amos
James
A 71 State Rd
East Westminster
MA 01473
2-06-2000 000006
$41,000.90
Berger
Tom
H 700 McDonald Lane
Merrimack
NH 03060
2-06-2000 000010
$12,341.60
Carroll
Alice
L 192 Lewis Road
London
NH 03416
2-07-2000 000012
$16,789.00
Carter
Winston
R 123 Timpany Street
Brookline
NH 03078
2-07-2000 000011
$23,416.76
Cooper
Frank
J 300 Mohican Avenue
Mohawk
MA 01480
2-07-2000 000014
$34,167.80
Dickens
Arnold
C 100 Bleak Street
Gardner
MA 01440
2-07-2000 000011
$12,341.67
Dickinson
Rose
E 21 Depot Road
Amherst
MA 01423
2-07-2000 000019
$66,688.90
Frost
Alfred
R 123 Amherst Street
Merrimack
NH 03060
2-07-2000 000020
$11,114.90
Hemingway
Joe
E 10 Cuba Street
Westminster
MA 01473
2-07-2000 000013
$87,690.00
Thoreaux
Ralph
H 800 Emerson Street
Walden
MA 01416
2-07-2000 000016
$6.00
Williams
Samuel
A 310 England Road
Worcester
MA 01400
2-07-2000 000017
$78,900.00
TOTAL RECORDS:
32
TOTAL SALES:
$732,927.86
VM-0660A-AI
10–48 Producing Printed Reports