SAS Base (8)

The SAS data set named WORK.SALARY contains 10 observations for each department,and is currently ordered by Department. The following SAS program is submitted:

data WORK.TOTAL;
set WORK.SALARY(keep=Department MonthlyWageRate);
by Department;
if First.Department=1 then Payroll=0;
Payroll+(MonthlyWageRate*12);
if Last.Department=1;
run;

Which statement is true?
A. The by statement in the DATA step causes a syntax error.
B. The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.
C. The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.
D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.

Check Answer
Answer: C

注解:和SAS Base (1)类似。

3 thoughts to “SAS Base (8)”

  1. I just don’t know why it is “monthly total” in option C. It seems that “MonthlyWageRate*12” represents yearly total. 为什么会是每个部分的月收入总和?不应该是每个部门的年收入总和嘛,乘以了12。

Leave a Reply

Your email address will not be published. Required fields are marked *