|
Hello,
> HI I would like to calculate in CL, to take the current date, and to add
> 45 days to this, and pass this UDate+45 to an RPG program in the next CL
> statement. (there are additional static parameters as well.)
There was a recent thread on this topic in this mailing list. Check the
archives... searching for CEEDATE may help.
Also, here's a quick sample program written in ILE CL that adds 45 days to
the current system date (which is different from "UDATE" -- UDATE is the
job date, and it's very rare that the job date is used by design instead
of by accident)
/* This requires ILE CL. Source type should be CLLE (not CLP!) +
compile me with CRTBNDCL. */
PGM
DCL VAR(&LILIAN) TYPE(*CHAR) LEN(4)
DCL VAR(&JUNK1) TYPE(*CHAR) LEN(8)
DCL VAR(&JUNK2) TYPE(*CHAR) LEN(23)
DCL VAR(&YMD8) TYPE(*CHAR) LEN(8)
DCL VAR(&SYSFMT) TYPE(*CHAR) LEN(10)
/* Get Current Date in Lilian format, add 45 days to it, +
then convert the result to YYYYMMDD format */
CALLPRC PRC(CEELOCT) PARM(&LILIAN &JUNK1 &JUNK2 *OMIT)
CHGVAR VAR(%BIN(&LILIAN)) VALUE(%BIN(&LILIAN) + 45)
CALLPRC PRC(CEEDATE) PARM(&LILIAN 'YYYYMMDD' &YMD8 *OMIT)
/* Convert the YYYYMMDD date to this system's default +
format and display it to the user */
CVTDAT DATE(&YMD8) TOVAR(&SYSFMT) FROMFMT(*YYMD) +
TOFMT(*SYSVAL) TOSEP(*SYSVAL)
SNDUSRMSG MSG('In 45 days the date will be' *BCAT +
&SYSFMT) MSGTYPE(*INFO)
ENDPGM
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.