Your code would not give the updated age for 2nd and 3rd year: id visit age gender 1 1 50 male 1 2 50 male 1 3 50 male 2 1 60 female 2 2 60 female 2 3 60 female We need one more step to correct it: data want;
set want;
if visit=2 then age=age+1;
if visit=3 then age=age+2;
run;
... View more