Date/time arithmetic in CL can be a chore. Command CHGDTETME allows flexible and easy CL date/time arithmetic.
Want yesterday's date? Simple:
CHGDTETME DTETME(*CURRENT) DURATION(*SUB *DAY) RTNVAL(&RESULT)
Or the date a month from now:
CHGDTETME DTETME(*CURRENT) DURATION(*ADD *MONTH) RTNVAL(&RESULT)
Or a week ago:
CHGDTETME DTETME(*CURRENT) DURATION(*SUB *WEEK) RTNVAL(&RESULT)
In addition to special values, Duration can be any combination of year, month, day, hours, minutes, and seconds:
YYYY-MM-DD-HH.MM.SS
Each segment can range from all zeros to all nines. ...