Question 41 :

 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?

  1. The BY statement in the DATA step causes a syntax error.
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering SAS Certification Material

 Correct Answer : 3

 Exp : When first.department is true payroll is set to 0. So the accumulator for each department is reset to 0 before accumulating. when you use PAYROLL + WAGERATE, variable payroll

 will automatically be retained through-out the dataset. Its values is resetted at first observation of each department. The observations to output dataset total are output on last

 observation of each department.

You can access to full explanation to question and answer from this page.