COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Table 69 Using the POSITION and KEY Phrases (continued)
EffectLength Used and RestrictionKeyPosition-Key
Relative key used alone4 (which is the length of the
relative key)
Full value of alternate AND
of prime used
length (entire alternate) +
length (prime) < 254
1
Alternate or alternate (1:n )
Prime key
Prime key (ORGANIZATION
INDEXED)
Prime key used alone
length (prime)
Full value of alternate used
alone
Full alternate must be unique
(no DUPLICATES) < 254
2
Same alternate or alternate
(1:n )
Alternate key
(ORGANIZATION INDEXED)
Full value of alternate used
alone
Full alternate must be unique
(no DUPLICATES) < 254
Same alternate or alternate
(1:n )
Alternate key
(ORGANIZATION RELATIVE)
1
For prime key (ORGANIZATION INDEXED), the supported alternate or alternate (1:n ) is length (entire alternate) + length
(prime) < 2047 in H06.28/J06.17 RVUs with specific SPRs and later RVUs. For a list of the required H06.28/J06.17
SPRs, see “SPR Requirements for Increased Enscribe Limits for the H06.28/J06.17 Release” (page 38).
2
For alternate key (ORGANIZATION INDEXED), full alternate must be unique (no DUPLICATES) < 2047 in H06.28/J06.17
RVUs with specific SPRs and later RVUs. For a list of the required H06.28/J06.17 SPRs, see “SPR Requirements for
Increased Enscribe Limits for the H06.28/J06.17 Release” (page 38).
Example 134 START Statement for Indexed File
SELECT RECEIVABLES-MASTER ASSIGN TO "RECMAST"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS INVOICE-NUMBER
ALTERNATE RECORD KEY IS COMPANY-NAME
WITH DUPLICATES.
...
PROCEDURE DIVISION.
...
OPEN I-O RECEIVABLES-MASTER
...
MOVE LOW-VALUES TO COMPANY-NAME
START RECEIVABLES-MASTER KEY NOT LESS THAN COMPANY-NAME
INVALID KEY
DISPLAY "ERROR STARTING READ FOR REPORT"
GO TO REPORT-EXIT
END-START.
GET-NEXT-RECORD.
READ RECEIVABLES-MASTER NEXT RECORD
AT END PERFORM...
Example 135 reads all records for employees whose last names start with G.
Example 135 START Statement With GENERIC Phrase for Sequential File
SELECT INPUT-FILE ASSIGN TO "INFILE"
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
ALTERNATE RECORD KEY IS EMP-NAME
WITH DUPLICATES.
...
FD INPUT-FILE
LABEL RECORDS ARE OMITTED
RECORD CONTAINS 95 CHARACTERS
DATA RECORD IS PERSONNEL-DATA.
01 PERSONNEL-DATA.
05 DEPT-NO PIC 9(5).
05 EMPLOYEE-NO PIC 9(7).
458 Procedure Division Verbs