The SAS data set Fed.Banks contains a variable Open_Date which has been assigned a permanent label of “Open Date”. Which SAS program temporarily replaces the label “Open Date” with the label “Starting Date” in the output?
A.
proc print data=SASUSER.HOUSES label;
label Open_Date “Starting Date”;
run;
B.
proc print data=SASUSER.HOUSES label;
label Open_Date=”Starting Date”;
run;
C.
proc print data=SASUSER.HOUSES;
label Open_Date=”Starting Date”;
run;
D.
proc print data=SASUSER.HOUSES;
Open_Date=”Starting Date”;
run;
Answer: B
注解:LABEL statement用于给变量定义标签,格式为:
LABEL variable = ‘label‘;
而PROC PRINT中的LABEL argument则是告诉SAS在打印数据时,输出该变量的label,而非默认的变量名。