By admin | September 21, 2009

SAS Certified Base Programmer 123 Questions (67)

The following SAS program is submitted:

data work.total;
    set work.salary(keep = department wagerate);
    by department;
    if first.department then payroll = 0;
    payroll + wagerate;
    if last.department;
run;

The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.

Which one of the following is true regarding the program above?

A. The BY statement in the DATA step causes a syntax error.
B. FIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.
C. The values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set.
D. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.

6 comments | Add One

  1. admin - 09/21/2009 at 10:55 am

    C

  2. Nethe - 10/16/2010 at 3:59 pm

    set work.salary(kep = department wagerate);

    Por favor puede revisar esta parte el kep solo tiene una e debería ser keep = por lo tantoe l programa no se ejecutaria y la respuesta sería A por favor puede revisar este punto gracias.

  3. admin - 10/18/2010 at 9:18 pm

    @Nethe Please write your comment in ENGLISH!

  4. sudha - 12/10/2010 at 10:57 am

    Keep is spelled wrong so question is sorta confusing…correct please

  5. admin - 12/10/2010 at 11:09 am

    @sudha thanks

  6. Crystal - 07/30/2012 at 4:23 pm

    “currently ordered by DEPARTMENT” should be “currently sordered by DEPARTMENT”.

    Then it is easy to get the correct answer.

Leave a Comment

Leave a Reply

Your email address will not be published.