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!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.