Sample Program Ex1010 - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Example 10–10 Sample Program EX1010
IDENTIFICATION DIVISION.
PROGRAM-ID. EX1010.
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 "EX1010.LIS".
DATA DIVISION.
FILE SECTION.
SD
SORT-FILE.
01
SORTED-CUSTOMER-MASTER-FILE.
02 SORT-NAME
02
FD
CUSTOMER-FILE.
01
CUSTOMER-MASTER-FILE
FD
SORTED-FILE.
01
CUSTOMER-MASTER-FILE.
02 NAME.
03 LAST-NAME
03 FIRST-NAME
03 MIDDLE-INIT
02 ADDRESS
02 CITY
02 STATE
02 ZIP
02 SALESMAN-NUMBER
03 INVOICE-NUMBER
03 INVOICE-SALES
03 INVOICE-DATE.
FD
PRINTER-FILE
REPORT IS MASTER-LIST.
WORKING-STORAGE SECTION.
01
UNEDITED-DATE.
02 UE-YEAR
02 UE-MONTH
02 UE-DAY
02 FILLER
01
ONE-COUNT
ASSIGN TO "EX1010-SORTIN.TMP".
ASSIGN TO "EX1010-SORTOUT.TMP".
PIC X(26).
PIC X(73).
PIC X(99).
PIC X(15).
PIC X(10).
PIC X.
PIC X(20).
PIC X(20).
PIC XX.
PIC 99999.
PIC 99999.
PIC 999999.
PIC S9(5)V99.
04 INV-DAY
PIC 99.
04 INV-MO
PIC 99.
04 INV-YR
PIC 9999.
PIC 9999.
PIC 99.
PIC 99.
PIC X(6).
PIC 9 VALUE 1.
Producing Printed Reports
10.9 Report Writer Examples
(continued on next page)
Producing Printed Reports 10–75

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Questions and answers

Table of Contents