We cannot see the end of your macro to see how you are making the report itself. Most likely you want to create the WHERE in the DATA step so that it has all the appropriate dates. You can also eliminate your DATA _NULL_ step. %let lastddate = %sysfunc(intnx(Month, %sysfunc(TODAY()), &n)); %let startdate = %sysfunc(intnx(Month, %sysfunc(TODAY()), %eval(&n-1))); the WHERE becomes something like: where &startdate le date le &lastdate; But until we know more of what you need these are guesses.
... View more