Hi,
I was creating a dynamic list of code string with semicolon and putting them on macro variables. When i try to verify these constructed statements, i found out that i could not print these as they contain semi colon. An example of my problem below,
data _null_;
call symputx('MyList','stuff with '||'&'||' and '||' ;'||' and some other stuffs');
run;
%put &=MyList;
Is there a way i could get around this? I dont have to use %put and my main purpose is to be able to review my list as my build is way more complicated that the example above.
Cheers for any help.
You can use macro quoting to allow the value to print without the macro processor trying to evaluate the semi-colon (or the & and % characters).
The %SUPERQ() macro function is a good way.
%put MYLIST=%superq(mylist);
You can use a Macro Quoting Function to get around this
%let MyList=%str(stuff with & and ; and some other stuffs);
%put &MyList;
You can use macro quoting to allow the value to print without the macro processor trying to evaluate the semi-colon (or the & and % characters).
The %SUPERQ() macro function is a good way.
%put MYLIST=%superq(mylist);
Thanks!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.