A raw data file is listed below:
--------10-------20-------30
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
The following SAS program is submitted using the raw data file as input:
data work.homework;
infile 'file-specification';
input name $ age height;
if age LE 10;
run;
How many observations will the WORK.HOMEWORK data set contain?
A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.
Disclaimer
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
This blog is not responsible for any kind of copyright violation. This blog just collects the links hosted or posted by other servers/people/search engines.The creator of this page or the ISP(s) hosting any content on this site take no responsibility for the way you use the information provided on this site.If anybody has any copyright claim on it and doesn’t wish the information provided to be shown on our site, please do respond to this email. We shall remove them off immediately. Any inconvenience is regretted. Please do mention your exact grievance/problems with respect to certain third party links. We assure you that appropriate action will be taken off. Thank you
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
This blog is not responsible for any kind of copyright violation. This blog just collects the links hosted or posted by other servers/people/search engines.The creator of this page or the ISP(s) hosting any content on this site take no responsibility for the way you use the information provided on this site.If anybody has any copyright claim on it and doesn’t wish the information provided to be shown on our site, please do respond to this email. We shall remove them off immediately. Any inconvenience is regretted. Please do mention your exact grievance/problems with respect to certain third party links. We assure you that appropriate action will be taken off. Thank you
15 comments:
Answer: C
This is a tricky question…
The values for name have embedded blanks and also no length statement…so the values assigned for age is . (missing) for all obs. And also . (missing) is always le 10. Therefore the output dataset has 3 obs.
data banks;
input name $ age height;
if age LE 10;
cards;
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
;
run;
C. 3
To get the correct answer
data new;
infile datalines;
input name & $ age hieght;
if age le 10;
datalines;
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
;
run;
Two blanks between name and age...
Answer C
if we specifies name variable length as 14 what will happen
Answer is C.
Please see SASGuru's comment.
All the length of variables is 8, by default.
C
answer is B
Atif, Can you please explain why B?
but the program after execution only gives one observation as output unless missover is included .
data new;
infile datalines;
input name & $ age height;
if age le 10;
datalines;
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
;
run;
proc print;
run;
Answer D, because name variable's length is not defined, it is having space between name string
dataset will be created but not complete, it is with error
I agree with Syed Zakr, this only gives one observation with missing data for both age and height.
the following error in the log.
NOTE: Invalid data for age in line 63 1-4.
NOTE: Invalid data for hieght in line 63 6-14.
The following script provides correct answer:
data banks;
input name $15. @16 age height;
if age LE 10;
cards;
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37
;
run;
Ans:C
Post a Comment