Hi.
Try this:
[pre]
* ensure data is sorted;
proc sort data=INDATA;
by ID;
run;
data OUTDATA;
set INDATA;
by ID;
retain _GOOD; * flag;
keep ID;
if first.ID then _GOOD=1; * assume its a good ID;
if SEQ not in (1,2) or ASSET not in (900,905) then _GOOD=0; * fails;
if last.ID and _GOOD; * output last obs if good ID;
run;
[/pre]
Works with your sample, but please do some more intensive tests.
Cheers from Portugal.
Daniel Santos @
www.cgd.pt