sorting wouldn't help. proc sql; select t1.individual, t1.datevar, count(*) as Occurrences from have t1 inner join have t2 on t1.individual = t2.individual and intck('day',t1.datevar, t2.datevar) <=90 and t2.datevar >= t1.datevar group by t1.individual, t1.datevar having count(*)>=3; quit;
... View more