SAS Certified Base Programmer 123 Questions (38)
The SASDATA.BANKS data set has five observations when the following SAS program is submitted:
libnamesasdata 'SAS-date-library'; data allobs; set sasdata.banks; capital=0; do year = 2000 to 2020 by 5; capital + ((capital+2000) * rate); output; end;
How many observations will the ALLOBS data set contain?
A. 5
B. 15
C. 20
D. 25
Topics:
SAS Base Questions |
9 Comments »
D
I believe this should be A. Correct me if I am wrong. The years run from 2000, 2005, 2010, 2015 n 2020. How does that amt to 25 observations ?
@2. AMJ….D is correct…SASDATA.BANKS data set has five observations
Why I think it should be D? The Do-End runs 5 times per observation. And SASDATA.Banks set has 5 observations. So 5 observations times 5 times per boservation equals 25. Correct me if I am wrong.
@ 4 JG, Sorry…Your are right….D is correct…..The 1st comment is always the correct answer.
data rrr;
input rate;
cards;
2
4
6
8
10
;
run;
data allobs;
set rrr;
capital=0;
do year = 2000 to 2020 by 5;
capital + (capital+2000);
output;
end;
run;
proc print;
run;
try executing this statement ……if any one has further doubt
D is the correct ans…..took a while to understand 🙂
Thats Correct
Can you please let me know how one can understand that SASDATA.BANKS contains 5 obs??
@Amit The first line of the question says: The SASDATA.BANKS data set has five observations when the following SAS program is submitted:. That’s why 5 obs.