Unlike a similar question you guys just helped me with - about how to de-dup a list of comma delimited values stored in a variable. My challenge is time is to find a method to prevent the CATX function from ever putting a duplicate date value into the list to begin with. If you have any thoughts on how to alter the code below to accomplish this I'd really appreciate the insights. The following piece of SAS code takes data rows that looks like this: BENE FROM_DT (stored in a SAS dataset as SAS date values) 12345 23OCT2010 12345 11NOV2015 12345 11NOV2015 12345 15DEC2011 12345 11NOV2015 And changes the multiple rows into a single row by Bene with the dates all transformed into a single variable named From_Date_List using the CATX function: BENE FROM_DT_LIST 12345 23OCT2010, 11NOV2015, 11NOV2015, 15DEC2011, 11NOV2015 PROC SORT DATA=FROM_DT_RESHAPE; BY BENE_SK; RUN; DATA FROM_DT_RESHAPED; LENGTH FROM_DT_LIST $1000; DO UNTIL (LAST.BENE); SET FROM_DT_RESHAPED; BY BENE; FROM_DT_LIST = CATX(', ',FROM_DT_LIST, PUT(FROM_DT, DATE9.)); END; KEEP FROM_DT_LIST BENE; RUN;
... View more