>>I tried this in Rexx. I found it astonishingly hard to get "the end of the
>>current month".
DFSORT has plethora of date related functions that can get the last day of
month, Quarter and year quite easily in either Gregorian format or Julian
format.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(DATE1, # current date
X, # Space
01,08,Y4T,LASTDAYM,TOGREG=Y4T, # Lastday of month
X, # Space
01,08,Y4T,LASTDAYQ,TOGREG=Y4T, # Lastday of Qaurter
X, # Space
01,08,Y4T,LASTDAYY,TOGREG=Y4T) # Lastday of year
/*
Output
20220630 20220630 20220630 20221231
/* Not tested for December, January, or February. */
DFSORT does the date validation considering leap years and can process the date
from 0001-01-01 thru 9999-12-31
Thanks,
Kolusu
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN