Your macro has a number of problems. 1) You define it with a parameter I, but then inside the macro you use the same variable I in a %DO loop. So the value passed into the macro is never used 2) Right after the %DO statement you have what looks like a data step assignment statement (j=i) but your macro is not generating a DATA step that could use such a statement. 3) You seem to be referring to macro variables such as I_CHAR, I_CH, J_CH and J that do not appear to have ever been created.
... View more