Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 10: File processing


DELETE statement

  • Used to logical remove records from indexed and relative files only
  • It deletes the most recently read record
  • To delete a record, the file should be opened in I-O mode
  • Basic syntax:-

    DELETE file-name RECORD [INVALID KEY imperative-statement-1] [NOT INVALID KEY imperative-statement-2] [END-DELETE].

  • Where,
    • file-name is logical file name from which record is to be deleted
    • INVALID KEY imperative-statement-1 : This becomes true when record is not found causes execution of imperative-statement-1
    • NOT INVALID KEY imperative-statement-2: This is used to specify statements to be executed when DELETE operation succeeds

Example of DELETE statement:-

***********NEED TO CREATE EXAMPLE REFER READ,REWRITE EXAMPLES ***********





© copyright mainframebug.com
Privacy Policy