全部版块 我的主页
论坛 经管考试 九区 经管考证
1784 2
2017-04-12
26. The following SAS program is submitted:
%let mvar=bye;
data _null_;
var1='hi';
var2='hello';
call symput('var1' || "&mvar", var2);
run;
Which one of the following is the name of the macro variable created by the CALL SYMPUT
statement?
Correct answer: c
a. var1
b. hibye
c. var1bye
d. No macro variable is created because the CALL SYMPUT
statement is not valid.
Your answer:
The CALL SYMPUT statement in this example uses the concatenation operator to join the text
string var1 with the resolved value of the macro variable reference &mvar, which is bye.
Therefore, the name of the new macro variable is var1bye.
此题选C不选B的原因在于,"var1"是用引号quote了的,带了引号的话SAS就认为其是个字符串而不是变量,因此不会resovlve 为 hi .
var1带引号就是字符串,一个具体的值,不带则是一个变量,一个变量name.


个人所吾!
二维码

扫码加我 拉你入群

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

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

全部回复
2017-4-12 10:15:56
补充知识点1: SQL中,insert into 和 undate是针对rows的,前者添加新的rows, 后者修改已有的rows;
                                alter是针对colomn的,可以修改,增加,删除colomn, modify为其选择项
二维码

扫码加我 拉你入群

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

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

2017-4-12 10:44:07
补充知识点2;MLOGIC option trace macro execution activity including the beginning of macro execution and the evaluation of % IF ;
                  MPRINT option specifies that text that is sent to the compiler as a result of macro execution is printed in SAS log.
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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