BookmarkSubscribeRSS Feed
IV
Calcite | Level 5 IV
Calcite | Level 5
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
2 REPLIES 2
Ksharp
Super User
Yes .it is five.
because
if last.department; means if last.department then output; So only five obs be output.

Ksharp
IV
Calcite | Level 5 IV
Calcite | Level 5
hi thanks very much

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1635 views
  • 0 likes
  • 2 in conversation