CALL SYMDEL Data Step Call Routine
CALL SYMDEL is a data step call routine which is used to delete macro variables from the global symbol table.
CALL SYMDEL(macro-variable<, option>);
%let mvar = xyz; data _null_; mvarName = ‘mvar’; call symdel(mvarName, ‘nowarn’); run;
Note: CALL SYMDEL issues a warning when an attempt is made to delete a non-existent macro variable. To suppress this message, use the NOWARN option.
WARNING: Attempt to delete macro variable MNAME failed. Variable not found.</p>Enter your text here…
%SYMDEL Macro Statement
The %SYMDEL routine deletes the specified variable from the macro global symbol table.
%SYMDEL variable-name ;
%SYMDEL statement gives a warning when an attempt is made to delete a non-existent macro variable. To suppress this warning in the log, you can use the NOWARN option.
%symdel variable-name / nowarn;
%let mname = ABC;%put &mname;%symdel mname;%put &mname;
So, this is the way you can delete macro variables in SAS. We really hope that you must have found it useful.
Moreover, if you have any other suggestion regarding other tips or tricks to add then suggest us below the comment section. We would really take those list in our further blog post.
Thanks for reading!
Do you any tips to add Let us know in the comments.