Hello, I am trying to calculate a percentage of health care providers that log into an online platform within a week of their patients logging in. I have a dataset with the date that the patient logged in as well as the dates in which the providers have logged in. This dataset will end up being very large (as the study will go on for 2 years with over 150 participants), so I need to figure out how to automate a SAS code to calculate weekly intervals based off of the date that the patients logged in. Not all patients log in on the same day, so I can't figure out how to do this. I found this macro online which makes weekly intervals, but I would need these intervals to be based off of a variable (participant_startdate) instead of a date that I could put in like this '24Jan2019'. I hope that makes sense! %let start='24Jan2019'd; %let end=date(); data set_weeks; retain fmtname 'weeks'; start=&start; end=start+6; label="Week: "||PUT(start, mmddyy10.)||" - "||PUT(end, mmddyy10.); OUTPUT; DO UNTIL (end > &end); start=start+7; end=end+7; label="Week: "||PUT(start, mmddyy10.)||" - "||PUT(end, mmddyy10.); OUTPUT; end; keep fmtname start end label; format start end mmddyy10.; run;
... View more