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.
Topics:
SAS Base Questions |
6 Comments »
C
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.
@Nethe Please write your comment in ENGLISH!
Keep is spelled wrong so question is sorta confusing…correct please
@sudha thanks
“currently ordered by DEPARTMENT” should be “currently sordered by DEPARTMENT”.
Then it is easy to get the correct answer.