I was trying to write a loop as follows: data ...; set ...; (a variable called attendance is included) temp=1; do until (temp=5); prev_attend=lag(attendance); if prev_attend=temp then attendance=prev_attend+1; temp+1; end; run; I was hoping to have the prev_attend updated each time the loop starts again, however this does not seem possible? Any suggestions? Thanks!
... View more