By admin | September 28, 2009

SAS Certified Base Programmer 123 Questions (87)

The SAS data set BANKS is listed below:

BANKS

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

9 comments | Add One

  1. admin - 09/28/2009 at 9:54 am

    B

  2. Bill - 10/14/2011 at 10:28 pm

    The answer should be 3 observations and 4 variables

  3. Bill - 10/14/2011 at 10:33 pm

    The answer is 3 observations and 4 variables

  4. ankit - 01/30/2012 at 8:04 am

    pls explain it

  5. har - 02/1/2012 at 5:41 pm

    Explain please…

  6. Qing - 05/12/2012 at 1:46 am

    why there are 4 variables?

  7. QIng - 05/31/2012 at 5:53 pm

    can you explain this

  8. truptali - 12/18/2012 at 12:53 am

    can you plz explain in detail why getting this result

  9. Lili - 07/25/2014 at 9:56 am

    There are two variables created, year and capital, in the program. And there are another two variables contained in the data set BANKS, which will be read into the new data set newbank by executing “set” and “run” statements. So there are four variables.

    Only encountered “run” statement, the values in the program data vector are written to the output data set as an observation. So the do loop only changes the values in the program data vector. And the end of data set banks is touched after three iterations in the do loop.

    I feel this questions emphasize the understanding of data step processing.

Leave a Comment

Leave a Reply

Your email address will not be published.