Thanks for the feedback. 1) Regarding dates, using 'd instead of 'dt still works, it will just ignore the time and look at the date portion. 2) No, output a single observation if multiple diagnoses found. That is a good point, a person could show up with both cannabis-related codes. However, the resulting datasets well be relatively small and I can do a proc sort with a nodupkey option afterwards. 3) Could point with the abbreviating that, I can adjust that. 4) I ran the code and it came up with many entries, all within the date range provided in the where clause, but they included many (most) entries without one of the cannabis-related ICD codes. My hope is that the code would identify entries that are within the date range, and then check them and output them if they match the array portion but it appears to ignore the array entirely.
... View more