I have an Excel sheet of 750,000 rows that span 8 months. I have to display all of the attributes, so Select * would be used. This is SAS Enterprise 9.4. This is an example of the attributes I'm interested in for the code: Attribute: Subscriber_Number | Date_Email_Sent 19202 03Dec2020 12829 03Dec2020 13455 05Dec2020 13455 05Dec2020 13455 02 Dec2020 13455 04 Dec2020 An email cannot be sent to a subscriber more than 3 times a week. If that happens, that would become an issue. My goal is to find subscribers who have been called more than 3 times a week. In the example data I gave, the code output should show that Subscriber 13455 was called 4 times in a week. The code output should NOT include 12829 because it just occurs one time. These are 2 different example codes that I tried and the problems I found with both: data counts; set have; by Subscriber_Number Date_Email_Sent; counter = dif(Date_Email_Sent) <= 7; run; proc summary data=counts; var counter; class Subscriber_Number, output out=sum sum=; The summary just shows the count all the times a Subscriber was reached out as long as it was less than 7 times, which is not what I'm looking for. Another Code that I saw that looked promising is this: PROC SQL; Select week (Date_Email_Sent, 'u') as weeknum, COUNT(Subscriber_Number) as per_week FROM Data; Where SubscriberNumber >2 Group By week(Date_Email_Sent, 'U') quit; I'm pretty new to SAS, so I'd love help!
... View more