Here's an example that I think does what you want; inelegant, but it does the job.
I mocked up data. Only cases 1 and 5 should be chosen, if I understand correctly what you want. Assumes you have id variable of some kind that uniquely identifies cases.
data list free /id year (2F2).
begin data.
1 3 1 4 1 5 1 6 1 7 1 8
2 1 2 4 2 8
3 4 3 5 3 6 3 7 3 8
5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9
end data.
* Syntax to select only cases with years 3 4 5 6 7 and 8.
do if $casenum > 1.
if id ne lag(id) keep=1.
if id=lag(id) and year=lag(year)+1 keep=keep+1.
leave keep.
else.
compute keep=1.
end if.
execute.
aggregate outfile=* mode addvariables /break=id /min=min(keep) /max=max(keep).
select if max ge 6 and year ge 3 and year le 8.
execute.
delete variables min max keep.
** Look at the data and see if it did what you need.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------