DATA Step, Macro, Functions and more

if last.var then output

Reply
N/A
Posts: 0

if last.var then output

Why is this set of codes not working as expected [only last observation (highest or last staff value) selected]?

data testing;
input id staff y$;
cards;
1 1 M
1 2 N
1 3 O
;

proc sort data =testing ;
by id staff;
run;

data testing2;
set testing ;
by id staff;
if last.staff then output;
run;

Thanks
N/A
Posts: 0

Re: if last.var then output

Posted in reply to deleted_user
OK, I got it!!!
Ask a Question
Discussion stats
  • 1 reply
  • 111 views
  • 0 likes
  • 1 in conversation