The following table shows example FILE-CONTROL
entries
for a QSAM sequential file, a VSAM indexed file, and a line-sequential
file.
Table 1. FILE-CONTROL entries
QSAM file |
VSAM file |
Line-sequential file |
SELECT PRINTFILE 1
ASSIGN TO UPDPRINT 2
ORGANIZATION IS SEQUENTIAL 3
ACCESS IS SEQUENTIAL. 4
|
SELECT COMMUTER-FILE 1
ASSIGN TO COMMUTER 2
ORGANIZATION IS INDEXED 3
ACCESS IS RANDOM 4
RECORD KEY IS COMMUTER-KEY 5
FILE STATUS IS 5
COMMUTER-FILE-STATUS
COMMUTER-VSAM-STATUS.
|
SELECT PRINTFILE 1
ASSIGN TO UPDPRINT 2
ORGANIZATION IS LINE SEQUENTIAL 3
ACCESS IS SEQUENTIAL. 4
|
- The
SELECT clause chooses a file in the COBOL
program to be associated with an external data set.
- The
ASSIGN clause associates the program's name
for the file with the external name for the actual data file. You
can define the external name with a DD statement or an environment
variable.
- The
ORGANIZATION clause describes the file's
organization. For QSAM files, the ORGANIZATION clause
is optional.
- The
ACCESS MODE clause defines the manner in
which the records are made available for processing: sequential, random,
or dynamic. For QSAM and line-sequential files, the ACCESS
MODE clause is optional. These files always have sequential
organization.
- For VSAM files, you might have additional statements in the
FILE-CONTROL paragraph
depending on the type of VSAM file you use.
|