The DELETE FILE statement causes the removal of the referenced files from the runtime file structure.


Each file referred to by file-name-1 is deleted from the runtime file structure provided the following conditions are all true:

  • The file is not in the open mode.
  • The file was not previously closed with lock during this execution of the program.
  • The file exists.
  • The runtime file system supports file deletion.
  • The file is not protected from deletion by a mechanism of the runtime file system.
  • The fixed file attributes specified for the file match the actual fixed file attributes of the existing file.

For each file referred to by file-name-1, the value of its file status data item, if any, is updated.

When a DELETE FILE statement references a file that does not exist, the statement executes successfully.Otherwise, a failure of deletion causes the execution of any applicable USE procedure.

DELETE FILE Statement Examples

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

COBOL Topics