IBM Extension
IBM Extension

Duplicates Phrase

If this phrase was specified for the file, the last input/output statement processed for this file before the processing of the DELETE statement must have been a successfully processed READ statement without the NO LOCK phrase. The record read by that statement is the record that is deleted.

In this case, the FORMAT phrase is not used to find the record to be deleted. The READ statement is required to ensure that the proper record is deleted when there are duplicates.

If a successful READ operation did not occur before the delete operation:
  • The file status key, if defined, is set to 94.
  • The EXCEPTION/ERROR procedure, if any, is run.
  • The DELETE statement is not processed.
If the last input/output statement was a successfully processed READ statement with the NO LOCK phrase:
  • The file status key, if defined, is set to 9S.
  • The EXCEPTION/ERROR procedure, if any, is run.
  • The DELETE statement is not processed.
If the value of the RECORD KEY data item has been changed since the record was read:
  • The file status key, if defined, is set to 21.
  • An INVALID KEY condition exists.
  • The DELETE statement is not processed.
End of IBM Extension
End of IBM Extension