You added some extra info, and I noticed some errors in my original suggestion, but I'm still not sure if this is what you want:
[pre]
data have;
input id date date9.;
cards;
1 10jan2005
1 17jan2005
2 10jan2005
2 16jan2005
2 9jan2005
3 5feb2006
3 5feb2007
4 5apr2008
4 4mar2009
5 7apr2010
;
proc sort data=have;
by id date;
run;
data want;
set have;
retain last met_condition_7day met_condition_year;
by id;
last=lag(date);
if first.id then do;
call missing(met_condition_7day);
call missing(met_condition_year);
end;
else do;
if date-last le 6 then met_condition_7day=1;
if date-last le 364 and
date le mdy(3,31,year(last)+1)
then met_condition_year=1;
end;
if last.id then output;
run;
proc freq data=want;
tables met:;
run;
[/pre]
HTH,
Art
> The seven days need do not represent a week, or a
> standard Sunday-Monday, rather just if the two
> service dates are within 7 days of one another; or if
> the service dates are within the same 'year' from
> April 1st (2004-2008) and March 31 (2005-2009).
>
> The important thing to find out is if/how many
> individual people (based on their personal id) ansd
> occurences there are where there is more than one
> service in a seven day period, or in those 'years'.
>
> So it doesn't matter if you and I both had service
> dates within 7 days from one another, rather if I had
> more thatn one visit.
>
> I have done a first.id and last.id to see how many
> ids show up multiple times, now I just have to figure
> out how to check for the occurences in a week, or
> within the 'year'.