Compaq AAQ2G1FTK Marine Radio User Manual


 
Processing Files and Records
6.2 Identifying Files and Records from Within Your Compaq COBOL Program
Example 615 (Cont.) Specifying Indexed File Organization and Dynamic
Access Mode for an Indexed File
SELECT FLAVORS ASSIGN TO "DAIRY"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS ICE-CREAM-MASTER-KEY
ALTERNATE RECORD KEY IS ICE-CREAM-STORE-STATE
WITH DUPLICATES
ALTERNATE RECORD KEY IS ICE-CREAM-STORE-CODE.
FILE SECTION.
FD FLAVORS.
01 ICE-CREAM-MASTER.
02 ICE-CREAM-MASTER-KEY PIC XXXX.
02 ICE-CREAM-MASTER-DATA.
03 ICE-CREAM-STORE-CODE PIC XXXXX.
03 ICE-CREAM-STORE-ADDRESS PIC X(20).
03 ICE-CREAM-STORE-CITY PIC X(20).
03 ICE-CREAM-STORE-STATE PIC XX.
A00-BEGIN.
.
.
.
Example 6–15 defines a dynamic access mode indexed file with one primary
key and two alternate record keys. Note that one alternate record key allows
duplicates. Any program using the identical entries in the SELECT clause as
shown in Example 6–15 can reference the DAIRY file sequentially and randomly.
Refer to the Compaq COBOL Reference Manual for information relating to the
RECORD KEY and ALTERNATE RECORD KEY clauses.
Example 6–16 defines a line sequential file.
Example 616 Specifying Line Sequential File Organization with Sequential
Access Mode
IDENTIFICATION DIVISION.
PROGRAM ID. EX0616.
ENVIRONMENT DIVISION.
INOUT-OUTPUT SECTION.
SELECT MUSIC ASSIGN TO "CLASSICAL"
ORGANIZATION IS LINE SEQUENTIAL.
FILE SECTION.
FD MUSIC.
01 OPERA PIC X(9).
PROCEDURE DIVISION.
A00-BEGIN.
.
.
.
File organization is discussed in more detail in Section 6.1.1. Record access mode
is discussed in the following section.
622 Processing Files and Records