proc sort data=test;
by id year;
run;
data step1;
set test;
by id year;
retain startyear;
if first.id or export=0 then do;
suv=.;
startyear=.;
end;
if export=1 then suv+1;
if suv=1 then startyear=year;
run;
proc sql;
create table wanted as
select id, startyear, suv
from step1
where export=1
group by 1,2
having suv=max(suv);
quit;