In random and dynamic access modes, the results of using the DELETE statement depend on the file organization.
When it is a relative file, the system logically removes the record identified by the contents of the RELATIVE KEY data item. The space is then available for a new record with the same RELATIVE KEY value. If the file does not contain such a record, an INVALID KEY condition exists.
On an indexed file, the system logically removes the record identified by the contents of the RECORD KEY data item. If the file does not contain such a record, an INVALID KEY condition exists.
When EXTERNALLY-DESCRIBED-KEY is specified for the file, the key fields in the record area for the format specified by the FORMAT phrase are used to find the record to be deleted. If the FORMAT phrase is not specified, the first format defined in the program for the file is used to find the record to be deleted.