全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2470 3
2014-02-25

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,第二道题答案是BPre 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是不是到一定层数就停止了呢?

谢谢!

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-2-25 20:46:17
第一道题的解析过程应该是:第一次:&&sun  , 第二次:&sun  ,第三次:shine
第二道题的解析过程应该是:第一次:&&one ,   第二次:&one, 第三次:two
经供参考!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-2-26 08:36:56
1064384318 发表于 2014-2-25 20:46
第一道题的解析过程应该是:第一次:&&sun  , 第二次:&sun  ,第三次:shine
第二道题的解析过程应该是: ...
明白了,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-8-2 13:28:30
学习了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群