Constraints can have a status of check pending. A status of check pending means that the data in the record (row) violates a constraint. When a COBOL I/O statement is run, the system will ensure that a record cannot be inserted or updated that would cause a constraint to be violated. Any attempt to do so, will result in file status 9W (check constraint failure) or file status 9R (referential constraint failure). However, adding constraints where data already exists or restoring old data can cause constraint violations, and, thereby, statuses of check pending.
Once an established and enabled check constraint has been violated (has a status of check pending), data cannot be read from the file. For those insert, update, or delete operations that require a read for update, the I/O operation will not be performed. Otherwise, insert, update, and delete operations will be performed. In order to read from the file again after a check constraint has been violated, the check constraint has to be disabled using the Change PF Constraint (CHGPFCST) command.
Once an established and enabled referential constraint has a status of check pending:
To figure out what is causing the constraint violation, after the constraint has been disabled, you can use one of the following methods:
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.