Do you mean, you already have the duplicate_reason variable in your dataset? Hmm, i think i am confused with how your data looks like, See if my understanding is right: /*Another version*/ data want; set test; by id; length temp $100; retain temp ; if first.id then do; call missing(temp); temp= catx('|',run_id,run_date); end; else temp=catx('~',temp,trim(run_id)||run_date); if last.id and index(duplicate_reason,temp)=0 then duplicate_reason= catx('~',duplicate_reason,temp); keep id duplicate_reason; run; Regards, Naveen Srinivasan
... View more