For example:
If fields C and D are the same length, have the same data type, and have the same values, the file contains two records with a duplicate key. The term duplicate key applies only to a complete record key for the format. A record key for the format consists of the key fields defined for a DDS format for records residing on the database. The term does not apply to the common key for the file (only fields A and B in the example).
Define data-name-4 as an unsigned integer data item whose description does not contain the PICTURE symbol P. Do not define data-name-4 in a record description entry associated with this relative file. That is, the RELATIVE KEY is not a part of the record.
The FILE STATUS clause monitors the execution of each input-output operation on the file. When you specify the FILE STATUS clause, the system moves a value into the status key data item after each input-output request that explicitly or implicitly refers to this file. The value indicates the status of execution of the statement.
An optional status key data item may be specified for non-transaction and transaction file processing.
You must define data-name-5 in the Data Division as a 4-byte alphanumeric data item. You cannot define data-name-5 in the File Section.
Data-name-5 identifies the extended-file-status data item, which contains major and minor return codes. The first 2 bytes of the extended-file-status data item contain the major return code, and the last 2 bytes contain the minor return code. Return codes are moved into data-name-5 after any input or output operation (except the ACCEPT or CLOSE statement) on the TRANSACTION file.
In some cases, the major and minor return codes can indicate I/O errors when the file status code does not. The extended file status will have a value of zeros after you perform an I/O operation on an unopened file.
01 data-name-6. 02 function-key PIC X(2). (Function key feedback field) 02 device-name PIC X(10). (Program device name) 02 record-format PIC X(10). (Record format)
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.