How about start using the macroArray package:
Documentation is here.
Article describing the package is here from PharmaSUG (and here) and WUSS conferences.
Example:
%loadPackage(macroArray)
/*
%helpPackage(macroArray,'%array()')
*/
resetline;
/* create */
%array(mon[12] $ 4, function=put(intnx('month','1dec2021'd,_I_-1,"S"),yymmdd4.), macarray=Y)
/* use */
%put %do_over(mon);
%put %mon(1), %mon(2) ... %mon(12);
/* delete */
%deleteMacArray(mon, macarray=Y)
Log:
1
2 /* create */
3 %array(mon[12] $ 4, function=put(intnx('month','1dec2021'd,_I_-1,"S"),yymmdd4.), macarray=Y)
NOTE:[ARRAY] 12 macrovariables created
4
5
6 /* use */
7 %put %do_over(mon);
2112 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211
8
9 %put %mon(1), %mon(2) ... %mon(12);
2112, 2201 ... 2211
10
11
12 /* delete */
13 %deleteMacArray(mon, macarray=Y)
Bart
... View more