Hi everyone,
I have a long dataset and some missingness in my data. For places where there are some gaps in data I was wanting to carry forward the most recent value a maximum of TWO times. I have this code that carries forward the value of smokestat until the next non-missing value of smokestat, but I don't want it to carry it forward that far. I was having some issues adapting this code to only carry it forward a maximum of two visits. Any help appreciated!
data Aim2.Final; set Aim2.Final;
n=_n_;
if missing(smokestat) then do;
do until (not missing(smokestat));
n=n-1;
set Aim2.Final(keep=smokestat) point=n;
end;
end;
run;
Hi everyone,