Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 10

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


--------10-------20-------30
01012000


The following SAS program is submitted:
data test;
infile 'calendar';
input @1 date mmddyy10.;
if date = '01012000'd then event = 'January 1st';
run;


Which one of the following is the value of the EVENT variable?
A. 01012000
B. January 1st
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.


5 comments:

SASGuru said...

Answer D

The if date = '01012000'd then event = 'January 1st'; has a syntax error.
The date constant '01012000'd should be ‘01Jan2000’d.

data work.TEST;
infile cards;
input @1 date mmddyy10.;
if date = '01jan2000'd then event = 'January 1st';
cards;
01012000
;
run;

illinois said...

Any more on this one Sasguru? Why do you have to use '01Jan2000'd for the date constant?

Geoff said...

That's just the way it was programmed. The date constant can only recognize and convert date values given in the format 'ddmmmyyyy'd . It doesn't recognize the given series of numbers as a date.

Krishna Rajwanshi said...

My answer is D:
Here there is a syntax error.
The date constant displayed as '01012000'd should be ‘01Jan2000’d.
Not enough,wanna something more related to SAS Macros

sai venkat said...

Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.

SAS Online Training
Tableau Online Training|
R Programming Online Training|

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