SAS_Institute
A00-211 · Question #145
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. See the full explanation below for the reasoning.
Question
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 WORKSALARY contains 10 observations for each department, and is currently ordered by DEPARTMENT. Which statement is true?
Options
- AThe BY statement in the DATA step causes a syntax error.
- BThe statement payroll + wagerate; in the DATA step causes a syntax error.
- CThe values of the variable PAYROLL represent the total for each department in the WORK.SALARY
- DThe values of the variable PAYROLL represent a total for all values of WAGERATE in the WORKSALARY
How the community answered
(57 responses)- A5% (3)
- B9% (5)
- C84% (48)
- D2% (1)
Community Discussion
No community discussion yet for this question.