Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 34

The following SAS program is submitted:


data work.sales;
do year = 1 to 5;
   do month = 1 to 12;
      x + 1;
   end;
end;
run;


Which one of the following represents how many observations are written to the WORK.SALES data set?
A. 0
B. 1
C. 5
D. 60

5 comments:

SASGuru said...

Answer B
Since there is NO explicit OUTPUT statement the output will have 1 obs only

neurosas said...

B.
data work.sales;
do year = 1 to 5;
do month = 1 to 12;
x + 1;
output; end; /*60 with this output statement 'D' */
output; end; /* 5 with this out put statement 'C"*/
run; /* 1 with no output statement 'B' */

Pooja said...

What will be the value of x? 60?

Unknown said...

@ Pooja: Yes X = 60

Dutchy said...

If there is no OUTPUT statament, SAS will automatically substitute an implicit OUTPUT statement just before the run. (Also a Return). I do not know if that occurs during compiletime or executing time.

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