data work.total;
infile 'file-specification' end = eof;
input name $ salary;
totsal + salary;
run;
Which one of the following IF statements writes the last observation to the output data set?
A. if end = 0;
B. if eof = 0;
C. if end = 1;
D. if eof = 1;
Click Comment link to get answer
'D'
ReplyDeleteD
ReplyDeleteD
ReplyDeleteD
ReplyDeletePlease explain
ReplyDeleteend is sas keyword which will become true when SAS reads last record of a dataset. This value you cannot use directly in your program, so we create a alias name eof (end of file), but you can name it anything. EOF will carry the same value as internal variable END. So as we know 1=true and 0= false. if EOF = 1; will output only the last observation. Answer is D
ReplyDeleteB
ReplyDeleteUse of 'eof' with an infile statement tends to confuse folks. Infile has both "END" and "EOF" options. A better question would make "end=lastrow". Then "if lastrow = 1" or "if lastrow".
ReplyDeletehttp://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm
For latest and updated SAS certification dumps in PDF format contact us at completeexamcollection@gmail.com
ReplyDeleteRefer our blog for more details http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html
This is a poorly written question. The answer could be B or D depending on whether the eof is on the last line or another line after that.
ReplyDeleteIn other words, are there blank lines after data listing in the file?
if eof on is on the last line then D is the correct answer, otherwise the answer is B.
Answer is B
ReplyDeleteThank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeletesas data analytics training with placement support
D
ReplyDeleteI have been searching for SAS interview question and answers.This blog is very useful and informative.
ReplyDeleteThanks for sharing.
SAS Certification
d
ReplyDelete