Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 14

The contents of the raw data file EMPLOYEE are listed below:


--------10-------20-------30
Ruth  39 11 (39 starts at col-7 and 11 at col-10)

Jose  32 22
Sue   30 33
John  40 44

The following SAS program is submitted:


data test;
infile 'employee';
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
run;


Which one of the following values does the variable IDNUM contain when the name of the employee is "Ruth"?


A. 11
B. 22
C. 32
D. . (missing numeric value)

5 comments:

Breanne Cameron said...
This comment has been removed by the author.
Rujuta........ said...

B. 22

YOGESH KUMAR said...

B.22

data work.TEST;
infile cards;
input employee_name $ 1-4;
if employee_name = 'Ruth' then input idnum 10-11;
else input age 7-8;
put _all_;
cards;

employee_name=Ruth idnum=22 age=. _ERROR_=0 _N_=1
employee_name=Sue idnum=. age=40 _ERROR_=0 _N_=2
NOTE: The data set WORK.TEST has 2 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.12 seconds
cpu time 0.03 seconds

syed zakir said...

every input statement will attack a new line , hence idnum=22

Sunila Hedawoo said...
This comment has been removed by the author.

Post a Comment



Technology Top Blogs On our way to 1,000,000 rss feeds - millionrss.com Hihera.com Blog Directory - OnToplist.com blogarama - the blog directory Blog Directory
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