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:
PROC DATASETS LIB=work;
DELETE _ALL_ / MEMTYPE=DATA;
RUN;
If you want to delete
everything in the WORK data library, including compiled macros, program catalogs, views, etc., then try the following sample code:
PROC DATASETS LIB=work KILL;
RUN;
|