Hong Ooi
Hong Ooi

Reputation: 57686

Deleting all datasets in a library

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?

Upvotes: 6

Views: 12947

Answers (1)

Laurent de Walick
Laurent de Walick

Reputation: 2174

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

proc datasets library=lib kill;
run;
quit;

Upvotes: 14

Related Questions