Click on the Comments to view the Answers

Tuesday, January 19, 2010

INPUT statement

A raw data file is listed below.

1---+----10---+----20---+---
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51

The following program is submitted using this file as input:

data work.family;
infile 'file-specification';

run;

Which INPUT statement correctly reads the values for the variable Birthdate as SAS date
values?

a. input relation $ first_name $ birthdate date9.;
b. input relation $ first_name $ birthdate mmddyy8.;
c. input relation $ first_name $ birthdate : date9.;
d. input relation $ first_name $ birthdate : mmddyy8.;

Check the comments below for answers....


7 comments:

SASGuru said...

Answer: d

An informat is used to translate the calendar date to a SAS date value. The date values are in the
form of two-digit values for month-day-year, so the MMDDYY8. informat must be used. When
using an informat with list input, the colon-format modifier is required to correctly associate the
informat with the variable name.

Unknown said...

I think B also correct...

siva said...

Answer D only

Unknown said...

Answer is B.

Per SAS documentation, SAS date value is a value that represents the number of days between January 1, 1960, and a specified date.

Option B is giving the SAS dates, Option D is reading the dates as it is in input statement.

H. C. said...

both b and d

Anonymous said...

both b and d

Matt said...

D

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