I think you would want to use the INTNX function, with the alignment parameter set to E. You could also include this calculation in the %SYSFUNC macro function, and put it in a macro loop to increment to the last day of the next month each iteration of the macro.
... View more