By admin | October 9, 2009

SAS Certified Base Programmer 123 Questions (117)

The following SAS program is submitted:

data work.totalsales (keep=monthsales{12});
    set work.monthlysales (keep=year product sales);
    array monthsales {12};
    do i=1 to 12;
        monthsales{i}=sales;
    end;
run;

The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.

Which one of the following is the result of the above program?

A. The program fails execution due to data errors.
B. The program fails execution due to syntax errors.
C. The program executes with warnings and creates the WORK.TOTALSALES data set.
D. The program executes without errors or warnings and creates the WORK.TOTALSALES data set.

8 comments | Add One

  1. admin - 10/9/2009 at 10:51 am

    B

  2. chayan - 12/21/2011 at 2:11 am

    to get the appropiate result , wat whould be d correct syntax?

  3. monioy - 06/7/2012 at 1:05 pm

    why syntax error

  4. Amee - 08/13/2012 at 4:23 am

    Ans -B

    Arrays name can not be included in keep /drop options

  5. Anshu - 08/14/2012 at 2:09 am

    Please explain

  6. chentail - 02/18/2013 at 3:33 pm

    array does not stored with the data set.

  7. Rahul - 04/22/2013 at 1:54 pm

    Hi Admin,could you please explain??thanks

  8. Lili - 07/30/2014 at 12:54 pm

    For the question why an array cannot be kept, my understanding is that the array in sas is only a way designed to manipulate data not store data. Variables stores data in sas.

Leave a Comment

Leave a Reply

Your email address will not be published.