I have a character field called EXPLNTN_TYP_NUM_LIST that contains a list of ‘explanation’ code(s) separated by commas – i.e. “1,2, <x>, ..”. – that need to be translated into descriptive text(s) separated by commas – i.e. “explanation1, explanation2, <explanationx>, ..”. To make it a little more interesting, EXPLNTN_TYP_NUM_LIST can have up to a maximum of 9 possible explanation codes or the field could be blank/missing. So, the question is: how do I translate this list of codes in EXPLNTN_TYP_NUM_LIST to another field – say EXPLNTN_TYP_NUM_LIST_DESC – when I don’t know if the field will contain either a blank, 1 code or multiple codes separated by commas (up to 9 codes). Keep in mind that if the EXPLNTN_TYP_NUM_LIST field is blank/missing, I want to return a blank/missing value as a descriptive text. Note: I have built a character format table using PROC FORMAT called $EXPLNTN to build out the code translations. There are 16 possible code values. I'm not sure how to do this using Base SAS. Any help would be greatly appreciated.
... View more