The SAS data set SASUSER.HOUSES contains a variable PRICE which has been assigned a permanent label of "Asking Price".
Which one of the following SAS programs temporarily replaces the label "Asking Price" with the label "Sale Price" in the output?
A. proc print data = sasuser.houses;
label price = "Sale Price";
run;
B. proc print data = sasuser.houses label;
label price "Sale Price";
run;
C. proc print data = sasuser.houses label;
label price = "Sale Price";
run;
D. proc print data = sasuser.houses label = "Sale Price";
run;
Click Comment link to get answer
C
ReplyDeleteC
ReplyDeleteA
ReplyDeleteA
ReplyDeleteif C, you can not change the label. Because you have already define label in the proc print.
Permanent Labels can only be defined in Data Step, Proc step can only be used to define temp labels... and to get the o/p from Label statement in Proc Step we need to use label option.
Deleteat the beginning of the proc step,it is short for a label option.
Deleteif you are using label statment inside proc print then you need to use label option on your proc print statement. This label inside a proc is applied temporarily and will replace any permanent labels. Hence answer is C.
ReplyDeleteThanks ! That helped
DeleteAnswer is C
ReplyDeleteYes Answer C is Perfect
ReplyDeleteC
ReplyDeleteAnswer is A
ReplyDeleteThe question is changing label temporarily,not permanently.
Answer is C. Option A wont reflect the change in the output, so there wont be any change neither temporary nor permanent on the label.
ReplyDeleteI think it is 'c'. Can anyone tell the correct answer for this.
ReplyDeleteC 100%
ReplyDeletebcoz if you want to assagin temporary lable.
we need to assign like ;;d;;
The correct answer is C 100%
ReplyDeleteThis is the program that I had run:
data sashelp.birthday;
input empid birthdat date7.
lastname: $18.
firstnam: $15.
phone: $4.;
datalines;
459287 05JAN84 RODRIGUES JUAN 5879
127845 25DEC85 MEDER VLADIMIR 6231
254896 06APR80 TAYLOR-HUNYADI ITO 0231
;
proc print data=shilpa.birthday label;
format birthdat date7.;
label empid="employee_id";
label phone="phone_number";
label birthdat="DOB";
run;
After running this program I got the correct output as "empid" was changed to "employee_id" & the same result was obtained for the others. But if we remove the label option from proc print statement & just keep the label statement. It doesnt change the label so I think using label option in proc print statement alongwith label statement are necessary to produce the required output.
B and C both are similar...
Deleteit's C... I tried it
ReplyDeleteAt first I thought B and C are the same but looking closely -- B does not have an equal operator after price and so C is the correct code.
ReplyDeletedata test;
ReplyDeletev1 = 110700;
run;
proc print data=test label;
title 'Base SAS 32';
format v1 dollar11.2;
label v1 = 'test';
run;
Answer is C
C
ReplyDeleteIn the PRINT PROCEDURE," Default: If you omit LABEL OPTION, PROC PRINT uses the variable's name as the column heading even if the PROC PRINT step contains a LABEL statement. If a variable does not have a label, PROC PRINT uses the variable's name as the column heading." So the answer is C.
ReplyDeleteThe correct answer is C. Some of you said A and fot those of you who said that the correct answer is A, read the SAS help and syntax for proc print. If you want do display label in proc print, you have to secify label in the proc print statement and a label statement inside the proc print.
ReplyDeleteC
ReplyDeletec
ReplyDeleteC
ReplyDeleteThe second line of code is incorrect in every answer choice. It should be listed as:
ReplyDeletelabel Asking Price = 'Sale Price';