05-05-2014 03:48 PM
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-ate%left(&Num_Dates)
Is there a way to delete Date1 etc without having to list of all of them I normally use %symdel Thank you!
05-05-2014 03:58 PM
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.
05-05-2014 06:57 PM
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))||';') ;