Processing Files With An Indexed Organization; Two Types Of Indexed Files; Figure 5.9. Statements Used With Indexed File Organizations - IBM 5280 Programmer's Manual

Distributed data system, cobol
Hide thumbs Also See for 5280:
Table of Contents

Advertisement

INDEXED Organization
Processing Files with an Indexed Organization
Two Types of Indexed Files
Figure 5.9 shows the COBOL statements which can be used for indexed file
processing.
Division
Reading
Writing
Updating
SELECT
SELECT
SELECT
ASSIGN
ASSIGN
ASSIGN
ORGANIZA TION
ORGANIZA TION
ORGANIZA TION
IS INDEXED
IS INDEXED
IS INDEXED
RECORD KEY
RECORD KEY
RECORD KEY
Environment
FILE STATUS
FILE STATUS
FILE STATUS
Division
ACCESS IS
ACCESS IS
ACCESS IS
SEQUENTIAL
SEQUENTIAL
SEQUENTIAL
ACCESS IS
ACCESS IS
ACCESS IS
RANDOM
RANDOM
RANDOM
OPEN INPUT
OPEN OUTPUT
ACCESS IS
OPEN 1-0
WRITE
SEQUENTIAL
READ
CLOSE
OPEN 1-0
CLOSE
READ
REWRITE
DELETE
CLOSE
Procedure
Division
For ACCESS IS
RANDOM
OPEN 1-0
READ
WRITE
REWRITE
DELETE
CLOSE
Figure 5.9. Statements used with indexed file organizations
COBOL supports two types of indexed files. In one type, an entry for each
record is stored in a separate data set called an index data set. The entry
consists of the record's key and the record's location. Accessing this data set
is similar to the key indexed access method described in the 5280 System
Concepts manual.
In the other type of indexed organization supported by COBOL, the records
are kept in sequence in the file by the system each time you add or delete one.
Accessing this type of organization with the random access method is the
equivalent of using the direct by key access method described in the 5280
System Concepts manual.
Chapter 5. Diskette Input/Output
5-
21

Advertisement

Table of Contents
loading

Table of Contents