SAS Base (37)

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;

Check Answer
Answer: B

注解:LABEL statement用于给变量定义标签,格式为:
LABEL variable = ‘label‘;
而PROC PRINT中的LABEL argument则是告诉SAS在打印数据时,输出该变量的label,而非默认的变量名。

2 thoughts on “SAS Base (37)

    1. Neither B nor C changes the stored label. As the question asked, LABEL statement in PRINT procedure temporarily replaces the label.Whether or not you add LABEL argument, which only affects the output, the stored label always remains as “Open Date”. You can use PROC CONTENTS statement to check the stored label.

Leave a Reply

Your email address will not be published. Required fields are marked *