BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Siva_Harish
Obsidian | Level 7

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
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
since your macro variable contains macro resolve symbole '&' ,if you want print it you need mask it firstly by macro mask function :




data _null_;
call symput("test",'Events and T&E');
run;
%put %superq(test);

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

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'

 

Ksharp
Super User
since your macro variable contains macro resolve symbole '&' ,if you want print it you need mask it firstly by macro mask function :




data _null_;
call symput("test",'Events and T&E');
run;
%put %superq(test);

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 944 views
  • 1 like
  • 3 in conversation