s*********e 发帖数: 944 | 1 74. 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 retri... 阅读全帖 |
|
s*******2 发帖数: 499 | 2 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
local symbol table for the ONE macro
B. A macro variable DATE with the value 12SEP2008 is retrieved from the
local symbol table for the TWO macro
C. A macro variable... 阅读全帖 |
|
L******n 发帖数: 6 | 3 75. 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=31DEC1006;
%one(&date)
What is the result when the %put statement executes?
答案是12SEP2008 retrieved from the local symbol table for the TWO macro.
为什么不是12SEP2008 retrieved from the local symbol table for the ONE macro
?我的理解macro two 并没有local symbol table啊。
谢谢。 |
|
y****1 发帖数: 400 | 4 1. 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=31DEC1006;
%one(&date)
What is the result when the %put statement executes?
答案是12SEP2008 retrieved from the local symbol table for the TWO macro.
我在网上查了call symputx routine的用法,关于L的解释是:
L specifies that the macro variable is stored in the most local symbol
table that exists, which might be the global symbol table. |
|
y***t 发帖数: 644 | 5 第一题date在macro two里的local value是12SEP2008。
第二题不知道 |
|