Help using Base SAS procedures

Need some help

Reply
New Contributor IV
New Contributor
Posts: 2

Need some help

Hi guys

I need some help with a question coming from SAS base exam.

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;


Question:
The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments. Which one of the following represents how many observations the WORK.TOTAL data set contains?


From what i seen the answer is 5.

But i really need some explaination on this.

thanks in advance

IV
Super User
Posts: 9,681

Re: Need some help

Yes .it is five.
because
if last.department; means if last.department then output; So only five obs be output.

Ksharp
New Contributor IV
New Contributor
Posts: 2

Re: Need some help

hi thanks very much
Ask a Question
Discussion stats
  • 2 replies
  • 241 views
  • 0 likes
  • 2 in conversation