I have the following code that works fine. What I need is to replace commas in a=A.B,C string with asterisks to get s="A" "B" "C" string.
The data step version of the code works fine:
%let a=A,B,C; data a; s='"'||TRANSTRN("&a",",",'" "')||'"'; run;
/* dataset a: */ /* s */ /*"A" "B" "C" */
However, using %SYSFUNC(TRANSTR(...)) fails or produces wrong result:
%let s=%SYSFUNC(TRANSTRN(&a,",",'" "')); %put s=&s; /*ERROR: The function TRANSTRN referenced by the %SYSFUNC or %QSYSFUNC macro function has too many arguments.*/
%let s=%SYSFUNC(TRANSTRN("&a",",",'" "')); %put s=&s; /*s="A,B,C"*/
%let s=%QSYSFUNC(TRANSTRN(&a,",",'" "')); %put s=&s; /*ERROR: The function TRANSTRN referenced by the %SYSFUNC or %QSYSFUNC macro function has too many arguments.*/ Any help?
... View more