data have;
input id mret;
datalines;
1 8
1 5
1 6
1 9
2 63
2 95
2 6
2 8
;
data want(drop = c);
set have;
by id;
if first.id then c = 0;
c + 1;
if c le 3 then mret = .;
run;
data have;
input id mret;
datalines;
1 8
1 5
1 6
1 9
2 63
2 95
2 6
2 8
;
data want(drop = c);
set have;
by id;
if first.id then c = 0;
c + 1;
if c le 3 then mret = .;
run;