COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
DUPLICATES
means that alternate key values are not necessarily unique.
FILE STATUS clause
defines filestat as the file-status data item for the file. When a COBOL run-time I-O routine
completes an operation on the file, it stores the status code in filestat before returning
control to your program (see I-O Status Code (page 247)).
filestat
is a 2-character alphanumeric, nonnational data item defined in the Working-Storage
Section, Extended-Storage Section, or Linkage Section.
Usage Considerations:
• EDIT Files
A file assigned to an EDIT file can be open for output only if it has the file code 101. It can
be given the file code 101 by any of:
◦ The application that created it outside the COBOL program
◦ An ASSIGN command that was active during run unit initialization (the ASSIGN command
must have a CODE phrase)
◦ The COBOL_ASSIGN_ routine
The buffer size of an EDIT file created in the CRE is determined:
1. If an ASSIGN command includes the BLOCK parameter, that value is the buffer size.
(ASSIGN commands are allowed only in the Guardian environment.)
2. If Step 1 is not true and the file description entry for the EDIT file includes a BLOCK
CONTAINS clause, then that value is the buffer size.
3. If Step 2 is not true, the buffer size is 4,096.
• Alternate Record Keys
Records in a file can be read in the ascending order of alternate key values, even if the file’s
organization is sequential or relative. The order in which records are obtained using alt-key
can differ from the order in which the records are stored. You can define up to 31 alternate
keys for a file.
If you include the DUPLICATES phrase in the ALTERNATE RECORD KEY clause, the value of
alt-key need not be unique for each record in the file. Depending on the INSERTIONORDER
parameter of the alternate key file, records with duplicate alternate key values are inserted
(or retrieved) in either prime key order (the way NonStop systems software ordinarily works)
or in the order in which they were inserted in the file (as specified in the 1985 ISO/ANSI
COBOL standard).
The data description entry for alt-key cannot contain an OCCURS clause or be subordinate
to an entry that contains an OCCURS clause. The leftmost character position of an alt-key
item cannot correspond to the leftmost character position of another alt-key item in that
file.
The file-control entry can contain at most one ALTERNATE RECORD KEY clause that describes
a particular alternate record key of the file.
122 Environment Division










