BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ravindra2
Fluorite | Level 6

hi i am having 3 datasets which are suppurated by td_ i want to delete those datasets using code and these datasets stored in work library.

 

td_class;

td_cars;

td_heart;

 

these are my datasets.

 

data td_class;
set sashelp.class;
run;

data td_cars;
set sashelp.cars;
run;

data td_heart;
set sashelp.heart;
run;

thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

PROC DATASETS supports the colon operator like this

 

proc datasets lib=work nolist;
   delete td:;
run;quit;

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Do like this

 

proc datasets lib=work nolist;
   delete td_class td_cars td_heart;
run;quit;
ravindra2
Fluorite | Level 6

yes i agree with you but i need in condition code 

 

i created every dataset as td_ so i want to delete every dataset which is starting with 'td_' or separated by '_' thank you

PeterClemmensen
Tourmaline | Level 20

PROC DATASETS supports the colon operator like this

 

proc datasets lib=work nolist;
   delete td:;
run;quit;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2336 views
  • 2 likes
  • 2 in conversation