skip to main content

Procedure Division Statements : DELETE

DELETE
General Format
Format 1
DELETE File-Name RECORD
  [ INVALID KEY Statement-1 ] 
  [ NOT INVALID KEY Statement-2 ] 
  [END-DELETE]
Format 2
DELETE FILE File-Name [ File-Name-2 ... ]
Syntax rules
1.
2.
General rules
Format 1
1.
2.
3.
4.
5.
6.
7.
8.
9.
Format 2
10.
Examples
Format 1 - Delete record by key and validate invalid key
  move 5432 to cust-code
  delete cust-file
    invalid key display message "Key not found to delete! : " cust-code
    not invalid key display message "Successfully deleted customer : " cust-code
  end-delete
Format 2 - Delete temporary file after done with it.
open output cust-tmp-file
close cust-tmp-file
delete file cust-tmp-file

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left