17. The following SAS program is submitted:
%let sun=SHINE;
%let shine=MOON;
proc print data=weather(keep=sun shine moon);
sum &&&&sun;
run;
Which one of the following variables is summed in the resulting report?
A.SUN
B.MOON
C.SHINE
D None, an Error message will be written to the log
4. The following SAS program is submitted:
%let test = one;
%let one = two;
%let two = three;
%let three = last;
%put what displays is &&&&&test;
What is written to the SAS log?
A. what displays is one
B. what displays is two
C. what displays is three
D. what displays is last
第一道题答案是C,第二道题答案是B。Pre Guide 里面提到“When multiple ampersands or percent signs precede a name token, the macro processor resolves two ampersands (&&) to one ampersand (&), and re-scans the reference.”。我的疑问是按照这个逻辑,第一道题可以理解,可是第二道题应该是&&&&&test转化成&&&&test转化成&&&test转化成&&test转化成&test=one,可是答案选B,就是two。请问是我哪里理解错了呢?re-scan是不是到一定层数就停止了呢?
谢谢!