By admin | September 10, 2009

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

9 comments | Add One

  1. admin - 09/10/2009 at 1:49 pm

    D

  2. AMJ - 03/2/2010 at 4:11 pm

    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 ?

  3. admin - 03/12/2010 at 7:58 pm

    @2. AMJ….D is correct…SASDATA.BANKS data set has five observations

  4. JG - 07/25/2010 at 11:29 am

    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.

  5. admin - 07/28/2010 at 2:44 pm

    @ 4 JG, Sorry…Your are right….D is correct…..The 1st comment is always the correct answer.

  6. sudha - 12/7/2010 at 12:10 pm

    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 🙂

  7. MYK - 02/18/2011 at 8:45 am

    Thats Correct

  8. Amit - 12/1/2012 at 11:30 pm

    Can you please let me know how one can understand that SASDATA.BANKS contains 5 obs??

  9. Harvey - 03/23/2014 at 8:12 pm

    @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.

Leave a Comment

Leave a Reply

Your email address will not be published.