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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: