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?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.