Hello, I have a list of macro variables specified as below
proc sql noprint;
select count(distinct date) into :Num_Dates from &ds1;
select distinct date into : Date1-:Date%left(&Num_Dates)
from &ds1;
quit;
Is there a way to delete Date1 etc without having to list of all of them I normally use %symdel Thank you!
Put your processing in a macro. All defined macro variables will become in the scope local.
When the macro execution stops all local variables are deleted automatic. Nothing to bother about deleting them.
yes I am doing that but just wanted to know if there was a way for my own reference Thanks!
There is a dictionary view and data step view of macro variables. You can use that to create the list of variable names you want to delete.
Here's an approach like _null_ suggested:
data _null_ ;
set sashelp.vmacro ;
where scope='GLOBAL' and offset=0 and name like "DATE%" ;
call execute('%nrstr(%%)symdel '||trim(left(name))||';') ;
run ;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.