原题是adv130中的一题,程序为:
%macro location;
data _null_;
call symput('dept','sales');
run;
%let country=Germany;
%put _global_;
%mend;
%let company=ABC;
%location
-----题目问:被写入SAS log的宏变量有哪些?
我run的结果确实与答案一致,被写入的宏变量有 dept 和company
company好理解。
但定义macro location的时候,利用symput创建的宏变量 dept怎么也是global呢?
求解,谢谢各位~
搭车问跟这一题很类似的另一问题:
%macro location(country);
proc sql;
select 'sales',* into:dept
from sashelp.class;
quit;
%put _global_;
%mend;
%location(US)
程序RUN的时候有warning:INTO clause specifies fewer host variables than columns listed in the SELECT clause.
这个意思是说,创建的宏变量数量过少,对不?
这里的 select‘sales’,* ---怎么理解呢?sales是啥?为什么要加‘’,后面为啥是* ?
谢谢~~