try this:
data a;
input x y @@;
cards;
1 0
1 0
1 -1
1 0
1 1
2 0
2 0
2 6
2 7
2 0
2 9
;
run;
data a;
do _n_=1 by 1 until(last.x);
set a;
by x;
k=_n_;
output;
end;
run;
proc sql;
create table new
as select x,min(k)as k
from a
where y ne 0
group by x
order by x;
quit;
proc sql;
create table result as
select a.x,a.y from a inner join new
on a.x=new.x and a.k ge new.k;
quit;