As shown, your code will not accomplish very much, for a couple of reasons: The macro declaration has an unmatched paranthesis (the last right paranthesis closes the %QUOTE call, not the macro header). There is no %MEND statement, and no code that calls the macro Apart from that, I think your problem is with these statements: %let LstCols_u=%sysfunc(tranwrd(&LstCols,subjid,usubjid_use));
%let LstCols_use=%sysfunc(tranwrd(&LstCols_u.,race,race_use)); The problem being that the parameters to the function calls are lower case, but it seems that the LstCols macro variable contains uppercase letters. So you will never get RACE translated to RACE_USE. To make it work, try %let LstCols=%upcase(&LstCols); /* not necessary here, but just in case the parameter is lower case */ %let LstCols_u=%sysfunc(tranwrd(&LstCols,SUBJID,USUBJID_USE));
%let LstCols_use=%sysfunc(tranwrd(&LstCols_u.,RACE,RACE_USE)); What the code does otherwise? Not really sure, what is it supposed to do?
... View more