The DELETE statement removes a record from an indexed or relative file. For indexed files, the key can then be reused for record addition. For relative files, the space is then available for a new record with the same RELATIVE KEY value.
When the DELETE statement is executed, the associated file must be open in I-O mode.
___ Format _____________________________________________________________ | | | >>__DELETE__file-name-1__ ________ __________________________________> | | |_RECORD_| | | | | >__ __________________________________________ ______________________> | | |_INVALID__ _____ __imperative-statement-1_| | | |_KEY_| | | | | >__ ______________________________________________ __________________> | | |_NOT INVALID__ _____ __imperative-statement-2_| | | |_KEY_| | | | | >__ ____________ ___________________________________________________>< | | |_END-DELETE_| | | | |________________________________________________________________________|
After successful execution of a DELETE statement, the record is removed from the file and can no longer be accessed.
>_OS/2_> For OS/2 VSAM files, after the successful execution of a DELETE statement, any record lock held by the file connector on the deleted record is released. However, if any other file connector holds a lock on the record to be deleted, the DELETE statement is unsuccessful. <_OS/2_<
Execution of the DELETE statement does not affect the contents of the record area associated with file-name-1 or the content of the data item referenced by the data-name specified in the DEPENDING ON phrase of the RECORD clause associated with file-name-1.
If the FILE STATUS clause is specified in the File-Control entry, the associated status key is updated when the DELETE statement is executed.
The file position indicator is not affected by execution of the DELETE statement.
Subtopics:
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.