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);

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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