我试着解释一下:
1. %nrstr()函数发挥了它的功能。
经过%nrstr()函数,&a并没有解析成begin,而是直接作为两个字符赋给了%upcase函数
比如可以比较下面两句:
%put %upcase(&a);
%put %upcase(%nrstr(&a));
2. %upcase函数也执行了其大写的功能。
%upcase函数收到的是 &a 这两个字符, 而%upcase() 函数将小写的a变成了大写的A。
3.接下来还有一点:%UPCASE does not mask special characters or mnemonic operators in its result, even when the argument was previously masked by a macro quoting function.
也就是%upcase()作用完之后,&回复了其功能,因此%put的是 &A解析后的值。
比如:
%put %upcase(%nrstr(&a));
%put %qupcase(%nrstr(&a));
下面这个帖子是对macro quoting的一点粗浅解释:
https://bbs.pinggu.org/thread-3111084-1-1.html