Hi all,
I have a cohort with their medication start date, end date and ID. I'm trying to identify new users in 2017, ie. no other prescription prior 1 year from their index date or they have a gap longer than a year is also qualified.
1st I pulled anyone with earliest startdate in 2017 (recode as indexdate), then if any ID has an indexdate that's between indexdate-365 and indexdate-1, then they are flagged as ineligible.
data sample; informat startdate mmddyy10.; informat enddate mmddyy10.; input ID startdate enddate; format startdate enddate mmddyy10.; datalines;
1 7/12/2016 10/14/2017 1 10/14/2017 . 2 6/02/2014 12/17/2014 2 12/22/2017 7/8/2018
3 6/02/2016 . 3 7/22/2017 7/8/2018
I hope my long message makes sense to you. Thanks very much! I appreciate any hints and advice.
J.
Can you show what the result for that example data should look like?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.