Reading A Relative File Sequentially - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Example 6–29 Reading a Relative File Sequentially
IDENTIFICATION DIVISION.
PROGRAM-ID. REL04.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FLAVORS ASSIGN TO "BRAND"
ORGANIZATION IS RELATIVE
ACCESS MODE IS SEQUENTIAL
RELATIVE KEY IS KETCHUP-MASTER-KEY.
DATA DIVISION.
FILE SECTION.
FD FLAVORS.
01 KETCHUP-MASTER
WORKING-STORAGE SECTION.
01 KETCHUP-MASTER-KEY
01 END-OF-FILE
PROCEDURE DIVISION.
A000-BEGIN.
OPEN INPUT FLAVORS.
PERFORM A010-DISPLAY-RECORDS UNTIL END-OF-FILE = "Y".
A005-EOJ.
DISPLAY "END OF JOB".
CLOSE FLAVORS.
STOP RUN.
A010-DISPLAY-RECORDS.
READ FLAVORS AT END MOVE "Y" TO END-OF-FILE.
IF END-OF-FILE NOT = "Y" DISPLAY KETCHUP-MASTER.
Processing Files and Records
PIC X(50).
PIC 99.
PIC X.
Processing Files and Records 6–39
6.4 Reading Files

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