Nice solution. (no new answer. I modified the original question)?
%macro create_table();
PROC SQL;
CREATE TABLE TEST AS
SELECT DATE, NAME,
%DO i = 1 %to 3;
0 AS A&i.,
%END;
1 as B
FROM SOURCE;
QUIT;
%mend create_table;
%create_table();
Can this be expanded to allow a let evaluation within the loop (or something else that will hold a new macro-var)?
I have a large number of columns that in my case look over 13qtr of data, and within each bucket of 40 or so columns 13(40) there are a good number that look back for year ago data.
Thus I need something like:
let iPY = %eval(&i. +4)
but would love to avoid the +4 calc for each needed column in a qtr.