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. |
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.
(The TABLE option was added in PxPlus v6.30.)
(The ERASE logic to delete related segments was added in PxPlus v7.00.)
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.
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.
Example
0010 erase "PRNTFL"
0030 erase "SRTFL1",err=0040