Three things to add to @SASKiwi's suggestion:
It is rarely (if ever) necessary to store date or datetime literals in macro variables or parameters. It is easier and simpler to use the raw values.
And, if your macro contains macro code (%let, %if or %do), prevent premature execution of such statements with %nrstr.
You also seem to look back one year, so I added that.
next_date = intnx('MONTH', date, i, 'B');
prev_date = intnx('year',next_date,-1,'s');
YYMM = compress(put(next_date, yymm6.),'M');
call execute(cats('%nrstr(%Dave(',YYMM,',',prev_date,'));'));
... View more