1.The following SAS program is submitted:
%macro one(input);
%two
%put the value is &date;
%mend;
%macro two;
data _null_;
call symput('date', '12SEP2008');
run;
%mend;
%let date = 31DEC2006;
%one(&date)
What is the result when the %PUT statement executes?
A.A macro variable DATE with the value 12SEP2008 is retrieved from the global symbol table.
B.A macro variable DATE with the value 31DEC2006 is retrieved from the global symbol table.
C.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the ONE macro.
D.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the TWO macro.
Answer: A
2.The following SAS program is submitted:
%macro one(input);
%two
%mend;
%macro two;
data _null_;
call symputx('date', '12SEP2008', 'L');
run;
%put the value is &date;
%mend;
%let date = 31DEC2006;
%one(&date)
What is the result when the %PUT statement executes?
A.A macro variable DATE with the value 12SEP2008 is retrieved from the global symbol table.
B.A macro variable DATE with the value 31DEC2006 is retrieved from the global symbol table.
C.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the ONE macro.D.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the TWO macro.
Answer: D
3.
%macro one(input);
%two
%mend;
%macro two;
data _null_;
call symputx('date', '12SEP2008', 'G');
run;
%put the value is &date;
%mend;
%let date = 31DEC2006;
%one(&date)
What is the result when the %PUT statement executes?
A.A macro variable DATE with the value 12SEP2008 is retrieved from the global symbol table.
B.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the ONE macro.
C.A macro variable DATE with the value 12SEP2008 is retrieved from the local symbol table for the TWO macro.
D.A macro variable DATE with the value 31DEC2006 is retrieved from the local symbol table for the TWO
macro.
Answer: A
小弟初学SAS,看不懂,请帮忙解释一下这几道题,多谢!!