The following SAS program is submitted:
data work.new;
length word $7;
amount = 4;
if amount = 4 then word = 'FOUR';
else if amount = 7 then word = 'SEVEN';
else word = 'NONE!!!';
amount = 7;
run;
Which one of the following represents the values of the AMOUNT and WORD variables?
A. amount word
7 FOUR
B. amount word
7 SEVEN
C. amount word
4 FOUR
D. amount word
4 ' ' (missing character value)
Click Comment link to get answer
A
ReplyDeleteCould you please expalinn why A
ReplyDeletevalue of amount=7 over lap for amount=4.
ReplyDeleteput output statement before amount=7, we will get
amount=4 and word=four
then amount=7 overlapping amount=4.
check with below statement:-
data work.new;
length word $7;
amount = 4;
if amount = 4 then word = 'FOUR';
else if amount = 7 then word = 'SEVEN';
else word = 'NONE!!!';
output;
amount = 7;
output;
run;
hi~ thank you!! so much~:-)
DeleteYes;Your are dm right this time.
ReplyDeleteSAS reads the first amount 4 and we get the fist obs
4 four
as the sas reads amount = 7 then output, then it replaces the amount 4 to 7.
we get a output like this.
7 four
I ran the code and I found the answer is
ReplyDeleteword amount
FOUR 7
which is the reversed order of A.
Because "length word $7;" first produces a variable word in PDV, then amount = 4;
i am having an exam after 2 weeks...can you pls help me on questions? whether these type of Q's will be there in exam?
ReplyDeletea
ReplyDeleteA
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteA
ReplyDeleteA
ReplyDelete
ReplyDeleteBakire kızla kendi evinde annesi gelmeden kızlık bozuluyor ve anal porno yapmaya devam ediyor azgın genç çiftlerimiz.