Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 31

The SAS data set BANKS is listed below:


name rate

FirstCapital 0.0718
DirectBank 0.0721
VirtualDirect 0.0728


The following SAS program is submitted:


data newbank;
do year = 1 to 3;
    set banks;
    capital + 5000;
end;
run;


Which one of the following represents how many observations and variables will exist in the SAS data set NEWBANK?
A. 0 observations and 0 variables
B. 1 observations and 4 variables
C. 3 observations and 3 variables
D. 9 observations and 2 variables

3 comments:

SASGuru said...

Answer: B

The input dataset Banks has 3 obs that are read in the do loop…Since there is no explicit OUTPUT statement the output dsn NEWBANK will have 1 observation 4 variables
Name rate year capital.

Unknown said...

data banks;
infile datalines;
input bank $ rate6.4;
datalines;
FirstCapital 0.0718
DirectBank 0.0721
VirtualDirect 0.0728
;
run;
proc print data=banks;run;
data newbank;
do year = 1 to 3;
set banks;
capital + 5000;
end;
run;
proc print data=newbank;run;

Obs year rate capital

1 4 8 15000

Unknown said...

data banks;
infile datalines;
input bank $ rate;
datalines;
FirstCapital 0.0718
DirectBank 0.0721
VirtualDirect 0.0728
;
run;
proc print data=banks;run;
data newbank;
do year = 1 to 3;
set banks;
capital + 5000;
end;
run;
proc print data=newbank;run;

Obs year bank rate capital

1 4 VirtualD 0.0728 15000

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