BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am creating a macro.  My macro Variable have the '%' symbol . I am getting the following Warning. How I can avoid this warning.  My macro variable resolving correctly.

%let endlike= %nrstr(%t);
%let xx= %upcase(&endlike);

%put &xx &endlike;

SASuserlot_0-1662754929989.png

 

 Thank you for your inputs. 

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

The %UPCASE function will remove macro quoting.  If you want to keep the % sign quoted, change to %QUPCASE:

 

1    %let endlike= %nrstr(%t);
2    %let xx= %qupcase(&endlike);
3
4    %put &xx &endlike;
%T %t

View solution in original post

6 REPLIES 6
SASuserlot
Barite | Level 11

Thank you. But,  what about if any r real  macro invocation problems exist in my rest of the code.

PeterClemmensen
Tourmaline | Level 20

How do you distinguish between this example and 'real' macro invocation problems? 

SASuserlot
Barite | Level 11

I think that's my question too. Here in the log I can see it &XX resolved to '%T '  that's why I thought its not a  issue. Correct me if I am wrong.

Quentin
Super User

The %UPCASE function will remove macro quoting.  If you want to keep the % sign quoted, change to %QUPCASE:

 

1    %let endlike= %nrstr(%t);
2    %let xx= %qupcase(&endlike);
3
4    %put &xx &endlike;
%T %t
SASuserlot
Barite | Level 11

It worked. Thank you.

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
  • 6 replies
  • 1531 views
  • 4 likes
  • 3 in conversation