不要解析 %substr() 返回的宏变量文本,开头为 &
Don't resolve to macrovariable text returned by %substr() with & at the begining
我正在尝试引用宏变量的子字符串。代码是:
%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));
在日志中,我得到:
WARNING: Apparent symbolic reference HO not resolved.
&hola
&hola
&ho
问题是我需要按字面意义将值 &ho
分配给 amper2
,而无需任何解析尝试,就像我对 amper
所做的那样,这实际上是字符串 [=15] =]...有什么想法吗?
提前致谢!
改变
%nrbquote(%substr(¶m,1,3))
至
%qsubstr(¶m,1,3)
应该可以解决问题。
我正在尝试引用宏变量的子字符串。代码是:
%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));
在日志中,我得到:
WARNING: Apparent symbolic reference HO not resolved.
&hola
&hola
&ho
问题是我需要按字面意义将值 &ho
分配给 amper2
,而无需任何解析尝试,就像我对 amper
所做的那样,这实际上是字符串 [=15] =]...有什么想法吗?
提前致谢!
改变
%nrbquote(%substr(¶m,1,3))
至
%qsubstr(¶m,1,3)
应该可以解决问题。