Directives
PURGE Clear Data from a File
   
Format PURGE (chan[,ERR=stmtref])

Where:

chan$ Channel or logical file number of the file to be purged.
stmtref Program line number or statement label to which to transfer control.
   
Description Use the PURGE directive to erase all data from a given file number. Before you can execute the PURGE directive, the file must be opened and locked. A file erased using a PURGE directive still exists in the system but contains no data. (ProvideX returns disk space to the system while preserving the lock.) Any READ directives for a purged file return an End-of-File status.

Using PURGE (or REFILE) is faster than deleting the file and recreating it.



*Note* Under WindX, you can use EXECUTE "[WDX]..." to encapsulate a directive that is not supported across a WindX connection. See [WDX] Direct Action to Client Machine.


Multi-segment files If you want to erase the contents of a file that may have multiple segments you should make sure that the '+E' system parameter is enabled. This will assure all segments are deleted from the system.

The erasure of related segments is a +PxPlus Exclusive

   
See Also REFILE Clear Record from File,
LOCK Reserve File for Exclusive Use
   
Example 0010 OPEN (2)"PRNTFL"
0020 LOCK (2)
0030 PURGE (2)
0040 WRITE (2)TIM,DAY
...