nerdexam
SAS_Institute

A00-201 · Question #80

20: 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…

The correct answer is C. The values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set. See the full explanation below for the reasoning.

Question

20: 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?

Options

  • AThe BY statement in the DATA step causes a syntax error.
  • BFIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.
  • CThe values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set.
  • DThe values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    9% (3)
  • C
    85% (29)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full A00-201 Practice