data x1;
input id days score;
datalines;
1 1 23
1 2 34
2 1 45
2 2 46
3 1 35
3 2 40
;
proc sort;
by id;
run;
data new;
set x1;
by id;
if first.id then do;
score1=score;
retain score1;
end;
diff=score-score1;
if last.id then output;
run;
proc print;
run;
No comments:
Post a Comment