Hi @Jagadishkatam. I'm sorry, just tried your solution on the entire dataset. There are two more issues. Here another sample dataset: data test;
input id$2. effdate :$ enddate:$ ;
start=input(scan(effdate,2,'.'),best.);
startm=input(scan(effdate,1,'.'),best.);
end=input(scan(enddate,2,'.'),best.);
endm=input(scan(enddate,1,'.'),best.);
datalines;
1 01.1996 07.2000
1 08.2010 12.2012
1 12.2014 01.2017
2 12.2008 09.2013
2 07.2015 02.2018
;
run; Issues: 1) The code isn't picking up full enrollment for the year if enrollment begins January. See observation #1 - flag1996 should equal 1. 2) When the start or end dates have month 12, then the program doesn't work correctly. See observation #2 - flag2010 should be missing Observation #3 - flags 2014 and 2017 should be missing Observation #4 - flags 2008 and 2013 should be missing Everything works fine on observations (like obs #5) where start and/or end are not in month 12 and start not in month 1. Do you know how to solve this? Thank you so much!
... View more