I want to run a macro for 60 variables... /* step 1 : made a variable list */ Proc sql; Select distinct var_name into : var_list separated by ' ' from have; quit; /* Step 2 : defined the Marco */ %macro na_update(var); Data want; set have; &Var = tranwrd(&var, "NA", '0'); If &var="." then do &var = '0'; end; run; %mend; /* Runs fine if i run step 2 separately for single variable */ /* step 3 : call macro dynamically*/ %local i, next_var; %let i=1 ; %do %while (%scan (&var_list, &i); %let next_var = %scan(&var_list, &i); %na_update(& next_val); %let i = %eval(&i +1); %end; %mend; %macro_call(); The code is running fine if i run step 2 for single variable. On running the whole code, I get no errors but no desired output... Log looks good and values are assigned rightly... Not been able to understand the problem... Thanks in advance!
... View more