COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
FD RELFILE
RECORD CONTAINS 5 TO 200 CHARACTERS
LABEL RECORDS ARE OMITTED.
01 REL-RECORD.
...
WORKING-STORAGE SECTION.
...
01 KEYS-GROUP.
03 FIDLKEY PIC 9(8) COMPUTATIONAL.
These FUP commands declare the same relative file as the HP COBOL code in Example 282:
SET TYPE R
SET EXT (1000 RECS, 2000 RECS)
SET REC 200
SET BLOCK 2048
CREATE $FIDDL.DEE.D
Creating and Using HP COBOL Indexed Files
In an indexed file—a file with indexed organization—records are accessed by the values of a key
field within each record.
An HP COBOL program can create and write an indexed file that any other HP product capable
of handling indexed files can later read. An HP COBOL program can read an indexed file created
by any HP product.
An HP COBOL program can create, read, write, and purge indexed files. An HP COBOL program
must use the FILE_CREATE_ procedure to create an indexed file that has alternate keys.
An HP COBOL program cannot directly create an indexed file that has alternate keys, because
the operating environment maintains the alternate keys in one or more separate files, whose names
are recorded with the operating environment information about the indexed file (see Alternate
Record Keys).
An HP COBOL program can create an indexed file that does not have alternate keys simply by
describing the file as having indexed organization (but without alternate keys) and opening the
file for OUTPUT, EXTEND, or I-O. The HP COBOL run-time routines create the indexed file.
Example 283 Indexed File Without Alternate Keys
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INDFILE
ASSIGN TO "$COBOL.PROGS.JAKE"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS JAKE-KEY.
...
DATA DIVISION.
FILE SECTION.
FD INDFILE
RECORD CONTAINS 5 TO 200 CHARACTERS
LABEL RECORDS ARE OMITTED.
01 IND-RECORD.
...
WORKING-STORAGE SECTION.
...
01 KEYS-GROUP.
03 JAKE-KEY PIC X(18).
These FUP commands declare the same indexed file as the preceding HP COBOL code:
Creating and Using HP COBOL Indexed Files 867










