在做SAS ADVANCED 63题的时候,我发现有时宏变量引用时不加点有时却要加,这是为什么呢?
需要加点的:
Item 30
The following SAS program is submitted:
%let product=merchandise;
[_insert_%put_statement_]
and the following message is written to the SAS log:
the value is “merchandise”
Which macro statement wrote this message?
A. %put the value is ‘“‘&product.’”’;
B. %put the value is %quote(&product.);
C. %put the value is “&product.”;
D. %put the value is ““&product.””;
不需要加的:
Item 48
Given the following program and data:
data WORK.BDAYINFO;
infile datalines;
input Name $ Birthday : mmddyy10.;
datalines;
Alan 11/15/1950
Barb 08/23/1966
Carl 09/01/1963
;
run;
%let Want=23AUG1966;
proc print data=WORK.BDAYINFO;
[_insert_statement_]
run;
What is the WHERE statement that successfully completes the PROC PRINT and selects the observation for Barb?
A. where Birthday=&Want;
B. where Birthday=“&Want”;
C. where Birthday=“&Want”d;
D. where Birthday=‘&Want’d;
请问是为什么呢?谢谢!