delete considerations for VSAM

In the context of file I/O that does not involve databases, the EGL delete statement removes an indexed or relative record from a file. Serial records and CSV records are not valid targets for the delete statement.

If you want to delete an indexed or relative record, do as follows:
  • Issue a get statement for the record and specify the forUpdate option
  • Issue the delete statement, with no intervening I/O operation on the same file

Syntax


Syntax diagram for the delete statement with VSAM
recordVariable
This record variable contains the information to be deleted from the indexed or relative file.