Dear all, I'm working with the data, which contains dates with missing either month (replaced with UNK) or day (replaced with UN). UPD: the values look like this: 2022JAN15, 2022JANUN and 2022UNKUN. I have seen multiple posts on the same topic, but I'm still in pursue of the most elegant solutions. I have made it following: data want; set have; date_new=tranwrd(tranwrd(upcase(date), 'UNK', 'JAN'), 'UN', '01'); run; I wonder if it's possible to make with PRXCHNAGE: data want; set have; date_new=prxchange('s/(\d{4})((?(?=U)UNK|(\w{3})))((?(?=U)UN|(\d{2})))/$1 $3 $5/i', -1, AE.aestdat); run; But it fails to put JAN or 01, if the condition is met. Replace portions of the PRXCHANGE doesn't accept " | " as OR. Thank you in advance for your help and advice!
... View more