The following Question & Answer List is based on SAS questions received by the author.
Allocating and Deleting Files
How can I make sure that a file does not exist before I start processing?
You can now use a number of SCL functions in Base SAS data steps in SAS version 6.12, e.g.:
FILENAME datafil 'datafil1.dat';DATA _NULL_; rc=FDELETE('datafil'); SELECT (rc); WHEN (0) put 'File has been deleted!'; WHEN (20006) put 'File does not exist!'; OTHERWISE; END; STOP;RUN;FILENAME datafil CLEAR;
Can I delete all the datasets in the WORK data library?
Yes, if you only want to delete the DATA files in the WORK data library, then try the following sample code: