Directives
ERASE Delete File/Directory from System
   
Format ERASE [ TABLE] name$ [,OPT=options$ ] [,ERR=stmtref ]

Where:

name$ Name of file or directory to be deleted from the system. String expression
options$ Options to apply to the ERASE. Currently the only valid option is "ALLSEG" to erase all segments of a multi-segmented file.
stmtref Program line number or statement label to which to transfer control.
   
  Restrictions: A directory can only be deleted if it does not contain any files. ProvideX is subject to OS rules for the deletion of files or directories. In some operating systems, the ERASE directive is not accepted and will not delete the directory.
   
Description Use the ERASE directive to delete the file or directory you name. All disk space that was used by the file or directory is returned to the system. If you erase a file, all data in the file is lost.


*Note* WindX supports the use of this directive via the [WDX] or [LCL] tag; e.g., ERASE "[WDX]somefile.ext"... See [WDX] Direct Action to Client Machine.


   
TABLE option The keyword TABLE before the name$ indicates that the value provided is the logical table name for the file as defined in the currently opened Data Dictionary file. See OPEN DICTIONARY for more details.
   
Multi-segment files If you want to erase the contents of a file that may have multiple segments you need to either include an ,OPT="ALLSEG" or enable the '+E' system parameter. This will assure all segments are deleted from the system.

The TABLE option and issuing a ERASE against related segments is a +PxPlus Exclusive

   
Examples 0010 ERASE "PRNTFL"
0030 ERASE "SRTFL1",ERR=0040