I want to create a macro to dynamically catx a percentage with a lower and upper CI. The variables always look like this: a_percent a_low a_high b_percent b_low b_high c_percent c_low c_high Originally I was trying to put the suffix as a prefix so I can create arrays for percents, lows, and highs. Then I would be able to reference the arrays in a catx macro. data _null_; if 0 then set have; array percent {*} percent:; array low {*} low:; array high {*} high:; call symputx("dim_percent", dim(percent)); call symputx("dim_low",dim(low)); call symputx("dim_high", dim(high)); do i = 1 to dim(percent); call symputx(cats("percent_",i),vname(percent{i})); end; do i = 1 to dim(low); call symputx(cats("low_",i),vname(low{i})); end; do i = 1 to dim(high); call symputx(cats("high_",i),vname(high{i})); end; run; And the ultimate goal is to be able to loop through something like this: var1=catx("^n(", put(percent(i), percent20.3), put(low(i), percent20.3)); varwant=catx(", ", var1, put(high(i),percent20.3))||")";
... View more