Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting all datasets in a library

Tags:

sas

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?

like image 809
Hong Ooi Avatar asked Jul 12 '11 03:07

Hong Ooi


People also ask

How do I delete all datasets in SAS library?

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.

How do you delete a dataset in SAS?

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).

How do you delete a table from a library in SAS?

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.

How do you delete a data set?

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.


1 Answers

Use the kill option in the proc dataset to delete all files in a library.

proc datasets library=lib kill;
run;
quit;
like image 167
Laurent de Walick Avatar answered Sep 25 '22 21:09

Laurent de Walick