This probably has a really simple answer. How would I go about deleting all the datasets in a library? I did something like
proc datasets library=lib;
delete _all_;
quit;
but that just tries to delete the dataset called _all_
. Do I have to manually list all the datasets in the delete
command?
To delete all files in a SAS library at one time, use the KILL option in the PROC DATASETS statement. The KILL option deletes all members of the library immediately after the statement is submitted.
Use the DELETE statement to delete one or more data sets from a SAS library. If you want to delete more than one data set, then list the names after the DELETE keyword with a blank space between the names. You can also use an abbreviated member list if applicable (such as YRDATA1-YRDATA5).
Deleting with PROC DELETE The third option to delete a SAS table is with the PROC DELETE statement. You can use this option to delete one or more tables from different libraries. You need to specify the library's name if the data set is not in your work library.
To delete an entire data set, select the DATASET option (option 2). The next panel you see allows you to do several data set management tasks. To delete a data set, type D for delete on the OPTION line.
Use the kill option in the proc dataset to delete all files in a library.
proc datasets library=lib kill;
run;
quit;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With