To build on the problem. If you only wanted to match the Type 1 and 2 by id if they were <=15 days apart (Type 2 still occurring after 1). How would you modify this program? here are 2 more id's with multiple instances of type 1 with same amount and only 1 type 2. I tried adding another loop with a t2.next() but it wasn't dropping the first find. have: id dateTran Trans SourceType TranValueADj A009 3-Jan-20 Type1 A2 520.84 A009 15-Jan-20 Type1 A2 2008.8 A009 17-Jan-20 Type1 A2 520.84 A009 28-Jan-20 Type1 B2 1041.68 A009 31-Jan-20 Type2 520.84 A009 31-Jan-20 Type1 A2 520.84 A011 2-Jan-20 Type1 A2 1023.3 A011 14-Jan-20 Type1 M1 1023.3 A011 15-Jan-20 Type1 A2 1703.1 A011 17-Jan-20 Type2 1023.3 want -added the number of days based on excel function, i realize sas may be slightly different: id dateTran Trans SourceType TranValueADj MatchedDate MatchedAmt daysafter A009 3-Jan-20 Type1 A2 520.84 A009 15-Jan-20 Type1 A2 2008.8 A009 17-Jan-20 Type1 A2 520.84 31-Jan-20 520.84 14.00 A009 28-Jan-20 Type1 B2 1041.68 A011 31-Jan-20 Type1 A2 520.84 A011 2-Jan-20 Type1 A2 1023.3 17-Jan-20 1023.3 15.00 A011 14-Jan-20 Type1 M1 1023.3 A011 15-Jan-20 Type1 A2 1703.1
... View more