user1481397
user1481397

Reputation: 433

SAS, delete multiple dataset

If I have dataset AA1, AA2, AA3, AA4,...AA100 how do I delete all of them? I tried

proc sql; 
drop table AA1-AA100;
quit;

It didn't work. I do not want to use kill because I do not want to delete all dataset in that lib. Is there a better way to do it instead of using loop?

Upvotes: 1

Views: 7091

Answers (1)

Longfish
Longfish

Reputation: 7602

Use proc datasets instead, this accepts AA1-AA100 syntax, or the colon wildcard operator (e.g. AA: to delete all datsets beginning AA).

proc datasets lib=work;
delete aa1-aa10 ;
quit;

Upvotes: 4

Related Questions