data HAVE;
input SUBJID VISITN AVAL;
cards;
001 1 26
001 2 41
001 3 35
002 1 12
002 2 21
003 1 22
;
run;
data want;
set have;
by SUBJID;
output;
if last.SUBJID;
DTYPE="LOCF";
if VISITN<5
then do VISITN = VISITN+1 to 5;
output;
end;
run;
input SUBJID VISITN AVAL;
cards;
001 1 26
001 2 41
001 3 35
002 1 12
002 2 21
003 1 22
;
run;
data want;
set have;
by SUBJID;
output;
if last.SUBJID;
DTYPE="LOCF";
if VISITN<5
then do VISITN = VISITN+1 to 5;
output;
end;
run;
No comments:
Post a Comment