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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1274 views
  • 0 likes
  • 2 in conversation