I have a data containing names, SSN, date of service, and oranges as column names. Each person is to receive one orange within a week, i.e. any day from sunday to saturday. I need help with a sas code to flag all SSN that received more than one orange within the specified one week period. The code below is flagging those who received oranges on sunday as well, however, any sunday is the first day of the week. Thanks! data mydata; by SSN date; days_passed=dif(date); if SSN=0 and days_passed in (1,2,3,4,5,6) then event=1; drop days_passed; run;
... View more