Regardless of how you do this (in a data step, or in a macro), you should do it in a loop, which would go from Y=1 to 28 and synchroniously from Z=0 to 27.
I think you're far better off in a data step loop than a macro loop. It will NOT require any use of a macro function (such as %sysfunc). Also note the adding, say 5, to an INTNX function advance the date by exactly 5 days. So there is no need for the "INTNX(date" usage. Just add Y or Z.
data _null_;
do Y=1 to 28;
Z=Y-1;
call symput(cats('M',Y),put(intnx('month',today(),-1,'b')+Y,date9.));
call symput(cats('E',Z),put(intnx('month',today(),0,'b')+Z,date9.));
end;
run;
... View more