Dave Laansma took a more generic approach which does not require knowledge of the date format - hence I thought it preferable.
My style would move the addition and subtraction around as below I assumed one would want the last day of the month for any called date otherwise uncomment line 2 SUBROUTINE GET.EOM(IDAY) *IDAY = DATE() THIS = OCONV(IDAY,'DM') LOOP IDAY += 1 UNTIL OCONV(IDAY,'DM') NE THIS REPEAT IDAY -= 1 RETURN Code snippets are fun - copyright not so much. Regards, Keith _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users