DATA Step, Macro, Functions and more

How to use the open parenthesis as a value for a macro variable?

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

How to use the open parenthesis as a value for a macro variable?

Why I can not run the macro as below, but if I set other special value like decimal  for the varibale CHAR, it will work. Do you have any suggestion if i want to scussfully run the code below, thank you.

%macro align1(char= ) ;

%put this is  &char  ;

%mend ;

%align1(char=%nrstr( ( )   )    ;


Accepted Solutions
Solution
‎03-13-2014 05:21 AM
Super User
Posts: 7,820

Re: How to use the open parenthesis as a value for a macro variable?

You just need a slight modification at invocation:

%align1(char=%str(%());

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎03-13-2014 05:21 AM
Super User
Posts: 7,820

Re: How to use the open parenthesis as a value for a macro variable?

You just need a slight modification at invocation:

%align1(char=%str(%());

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 2

Re: How to use the open parenthesis as a value for a macro variable?

Posted in reply to KurtBremser

Thanks for your answer, this is exactly what I want.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 217 views
  • 0 likes
  • 2 in conversation