Thanks a lot for all your help. I still can't make it work though. Modifying a bit so that it sort of represents the data wherein Group is actually 3 variables. And yes, those are SAS numeric dates. Also looking for the most efficient way as this will run through millions of records. Example Data: Group1, Group 2, Group3, VarID,VarDate1,VarDate2,VarDate3,VarDate4,VarDate5 A,AA,AAA,15,Oct2018,Oct2018,.,.,Oct2018 A,AA,BBB,2,.,.,.,.,Jan2019 A,AA,CCC,3,.,.,Sept2018,.,., A,AA,DDD,14,.,.,.,.,Dec2018 B,AA,AAA,45,July2018,.,.,.,July2018 B,AA,BBB,46,.,.,.,.,.July2018 Result Data should be: Group1, Group 2, Group3, VarID,VarDate1,VarDate2,VarDate3,VarDate4,VarDate5 A,AA,BBB,2,.,.,.,.,Jan2019 B,AA,BBB,46,.,.,.,.,.July2018
... View more