Hi,
I've created an example in paint of how my dataset should look like (made a mistake with analys code 000001, the experience should of course go to 4 instead of 5):
http://img850.imageshack.us/img850/696/exampled.png
At this moment I'm having the timeID and Analys variables and I should calculate the experience.
I was thinking about something like this:
data experience;
set experience;
if analys ne lag(analys) then do;
experience=1;
end;
else experience=experience+1;
run;
The problem however is that it only puts a 1 on the first row when the analystcode changes but the other observations give experience=.
Anyone knows what I'm doing wrong here?
Thanks a lot!
Message was edited by: jebuske