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'
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.