Hi All, below is the code to create a quoted list separated by spaces. I am trying to modify the program using translate function to create a new list in the same code which contains the output is a list separated by commas. But, what I am trying is not working. Please, help me how to correct this error. Here, is the code that creates a quoted list separated by spaces: data one; input empl $; datalines; 12345 67890 45678 ; %let list=; data _null_; set one; call symputx('mac',quote(strip(empl))); call execute('%let list=&list &mac'); run; %put &=list; Output in the log: %put &=list; LIST="12345" "67890" "45678" Now, I am trying to use this LIST in the same program to create a new list separated by commas . Here, is the code that I am trying: %let list=; %let var1=; data _null_; set one; call symputx('mac',quote(strip(empl))); call execute('%let list=&list &mac'); call execute('%let var1=$sysfunc(translate(&list,',',' '))'); run; %put &=list; %put &=var1; In the log errors are: 59 call execute('%let var1=$sysfunc(translate(&list,',',' '))'); ---- 22 ------- 253 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, LE, LT, MAX, MIN, NE, NG, NL, OR, ^=, |, ||, ~=. ERROR 253-185: The EXECUTE subroutine call has too many arguments. 60 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 61 62 %put &=list; LIST= 63 %put &=var1; VAR1=
... View more