Hi
I am trying to delete all the macro variables in a program and can't seem to find a method.
Saw that some people have suggested to use %SYMDEL but I don't know how to delete all the macro variables using it.
Can someone please help me?
Thanks
First, you have to realize that what you requested is not possible. You can only delete GLOBAL macro variables, You cannot delete LOCAL macro variables, and you cannot delete AUTOMATIC macro variables that are supplied by the software. So if deleting GLOBAL macro variables will satisfy what you need to do, here is a link that shows you how:
https://www.lexjansen.com/nesug/nesug06/po/po06.pdf
The specific example you requested begins at the bottom of page 3.
Use the following options at the top of the program:
options mfile mprint obs=0 noerrorbyabend errors=0 source source2 nonotes;
filename mprint 'c:\temp\SasCode.txt’;
When you run your program, a new copy of it will be in the SasCode.txt file with all macros resolved.
First, you have to realize that what you requested is not possible. You can only delete GLOBAL macro variables, You cannot delete LOCAL macro variables, and you cannot delete AUTOMATIC macro variables that are supplied by the software. So if deleting GLOBAL macro variables will satisfy what you need to do, here is a link that shows you how:
https://www.lexjansen.com/nesug/nesug06/po/po06.pdf
The specific example you requested begins at the bottom of page 3.
Thanks.
I only wanted to delete the global macro variables I defined.
Regards.
Use this code to get all the macro variables .and %symdel them all.
proc sql; create table x as select * from dictionary.macros; quit;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.