You could simply wrap it in a macro and use a macro loop. Something like this: %MACRO myMac; data want; do year = &FirstYear to &CurrentYr; output; end; retain %DO I = 1 %TO 120; m_%EVAL(&I.*3) %END; 0; run; %MEND;
... View more
You can see a follow-up post to your original, with a good solution for this:
https://communities.sas.com/t5/Base-SAS-Programming/Create-table-with-incremental-rows-and-years-for-columns/m-p/468725#M119772
... View more