I have dataset attached below. This dataset is simulating hospital/clinic data. Each observation defines a visit. A visit is defined as the unique combination of person, date, provider. I am trying to flag persons with at least 5 visits within a 30 day time span. I know how to use where and if statements and I have read from other forums about counting consecutive variable values but I'm unsure how to program for a range of within 30 days. Please excuse me if this is a very simple question but I am not that advanced of a SAS user and having a hard time visualizing this. I am trying a proc statement but I don't know what functions can give me the 5 visits within 3 days. I am stuck on code below. I don't know if I should even be trying to do this using a proc freq. Maybe I should be doing a data step? proc freq data=p.persons;
where date =
run; My version of SAS is 9.04.01M6P110718
... View more