Hi RW9, I completely agree that code should not be complicated unless absolutely necessary. But please have a look where the macrovariables are used further: %macro num_to_char;
%do i = 1 %to 18;
if PARAMCD in ("&&PARAMCD&i.") then do; QVAL_Mean_C = put(QVAL_Mean,16.%eval(&&DENOM&i.+1)-L);
QVAL_StdDev_C = put(QVAL_StdDev,16.%eval(&&DENOM&i.+2)-L);
QVAL_Min_C = put(QVAL_Min,16.&&DENOM&i.-L);
QVAL_Median_C = put(QVAL_Median,16.%eval(&&DENOM&i.+1)-L);
QVAL_Max_C = put(QVAL_Max,16.&&DENOM&i.-L);
end;
%end;
%mend num_to_char;
data tableX ;
format QVAL_Mean_C QVAL_StdDev_C QVAL_Min_C QVAL_Median_C QVAL_Max_C $200.;
set proc_mean_results;
NObs_C = put(NObs,16.0-L);
%macro num_to_char;
run; The list of parameters or the number of decimals can be changed anytime. I hope that using of the approach outlined can help to react faster.
... View more