Reputation: 347
I'm trying to quote a substring of a macro variable. The code is:
%let hola=resuelto!;
%macro prueba(param);
%let amper=¶m;
%let amper2=%nrbquote(%substr(¶m,1,3));
%put ¶m;
%put &er;
%put &er2;
%mend;
%prueba(%nrstr(&hola));
In the log, I'm getting:
WARNING: Apparent symbolic reference HO not resolved.
&hola
&hola
&ho
The problem is I need to assign amper2
literally the value &ho
, without any attempt of resolution, like I do with amper
, that gets literally the string &hola
... any idea?
Thank you in advance!
Upvotes: 2
Views: 53
Reputation: 629
Changing
%nrbquote(%substr(¶m,1,3))
to
%qsubstr(¶m,1,3)
should do the trick.
Upvotes: 2