Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To solve %nrstr() and %nrbquote() issues.

Status
Not open for further replies.

6656

Programmer
Nov 5, 2002
104
US
How to solve the macro y from below sample?

%let x=%nrstr(%let) %str(y=12;);
&x;
%put y= &y;

Thanks,
Mike

 
Mike,
You are trying to write a macro within a macro variable. The problem is, macro has to be compiled first before execution. You chosed right function %nrstr(). It masks % during the compilation. At the execution, &x becomes
%let y = 12; That is a macro statement and is not compiled. Therefore you get an error message.
It seems to me this can not be accomplished.
But, could you let us know what are you up to? There maybe other ways to get what you want.

Wei
 
Thanks all,

I try to get %let y=12; can be compiled. It seems can be resolved when doing remote submit.
 
The solution is that using %unquote(&x).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top