data test;
infile datalines;
input i;
datalines;
70
80
30
160
110
200
168
30
963
45
185
972
9
15
42
; run;
data test2(drop=i);
set test end=last;
if i<100 then do;
retain i;
j+i;
retain j;
end;
else if j>0 then do;
output;
j=0;
end;
if last and j>0 then do;
output;
end; run;
data test2(drop=i);
set test end=last;
if i<100 then do;
j+1;
end;
else do;
if j>1 then do;
output;
end;
j=0;
end;
if last and j>1 then do;
output;
end; run;
data test2(drop=i);
set test end=last;
if i<100 then do;
j+1;
end;
else do;
if j>1 then do;
output;
end;
j=0;
end;
if last and j>1 then do;
output;
end; run;