|
I found code on the web that helps, it will produce 14 observations in
a data set, but it creates a data set.. :( So I would still have to
merge stuff together? so it could be counted as part of proc summary,
or the like? And still have to make a data set for each leave code?
data testing;
set perm.f20032004 (rename=( actualhrs=actlhrs leavecd=leave_code));
where leave_code='952';
by emplid Leave_code;
* reset score at each change of recno;
if first.emplid then score = 0;
* increment score at each change in comp, except when comp=0;
if first.leave_code and leave_code <> 0 then score + 1;
* output the accumulate score before the next change in recno;
if last.emplid then output;
run;
data testing2;
do until (last.emplid) ;
set perm.f20032004 (rename=( actualhrs=actlhrs
leavecd=leave_code));where leave_code='952';
by emplid leave_code ;
score = sum (last.emplid) ;
end ;
run ;
|