Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 35

A raw data record is listed below:


--------10-------20-------30
1999/10/25


The following SAS program is submitted:
data projectduration;
infile 'file-specification';
input date $ 1 - 10;
run;


Which one of the following statements completes the program above and computes the duration of the project in days as of today's
date?
A. duration = today( ) - put(date,ddmmyy10.);
B. duration = today( ) - put(date,yymmdd10.);
C. duration = today( ) - input(date,ddmmyy10.);
D. duration = today( ) - input(date,yymmdd10.);

3 comments:

SASGuru said...

Answer: D
The input date is character variable whose value should be converted to numeric using the input function with the yymmdd10. Informat.

Anonymous said...

we have to add 1 for no .of days calculations

Dutchy said...

If you have to convert a char variable to numeric, you must use INPUT-function (numeric to char is PUT-function).
So it must be C or D
Only D used the correct informat.

So it is 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