COBOL/400 Language Help
The invalid key condition can occur during execution of a DELETE, READ,
REWRITE, START, or WRITE statement. When an invalid key condition
occurs, the input-output statement that caused the condition is
unsuccessful.
When the invalid key condition exists after an input-output operation,
actions are taken according to the type of error handling in effect:
- With standard error handling, if there is an applicable file status clause
(but not an applicable USE procedure), the file status is updated, and control
returns to the program. In the absence of a file status clause, USE
procedure, or INVALID KEY phrase to handle the error, a run-time message is
issued, giving you the option to end or return to the program.
- Without standard error handling, the status key, if specified, is
updated. If an explicit or implicit EXCEPTION/ERROR procedure is
specified for the file, the procedure runs. If no such procedure is
specified, the results are unpredictable.
If the invalid key condition does not exist after execution of
the input-output operation, the INVALID KEY phrase, if specified, is ignored,
and the following actions are taken:
- If an exception condition which is not an invalid key condition exists,
control is transferred according to the rules of the USE statement following
the execution of any USE AFTER EXCEPTION procedure.
- If no exception condition exists, control is transferred to the end of the
input-output statement or the imperative statement specified in the NOT
INVALID KEY phrase, if specified.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.