Hi Commuters ,
data _null_;
call symput("test",'Events and T&E');
run;
%put &test.;
I tried using all macro quoting functions but no use .can help me to get out of this Warning?
log :
1552 data _null_; 1553 call symput("test",'Events and T&E'); 1554 run; NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.03 seconds WARNING: Apparent symbolic reference E not resolved. 1555 1556 %put &test.; Events and T&E
You need to quote the string with the & (and also %) in it.
Either add some macro quoting or add some real quotes.
data _null_;
call symputX("test",'Events and T&E');
run;
%put &=test;
%let test=%superq(test);
%put &=test;
data _null_;
call symputX("test",'''Events and T&E''');
run;
%put &=test;
401 data _null_; 402 call symputX("test",'Events and T&E'); 403 run; NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds WARNING: Apparent symbolic reference E not resolved. 404 %put &=test; TEST=Events and T&E 405 %let test=%superq(test); 406 %put &=test; TEST=Events and T&E 407 408 data _null_; 409 call symputX("test",'''Events and T&E'''); 410 run; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 411 %put &=test; TEST='Events and T&E'
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.