| 
 | 
Hi Dwayne,
Can you add to system date in a cl, if so how? We capture the system date and than we would like to add a day or two to it.
Here's a sample:
PGM
     DCL VAR(&QDATE) TYPE(*CHAR) LEN(6)
     DCL VAR(&YYMD)  TYPE(*CHAR) LEN(8)
     DCL VAR(&LILIAN) TYPE(*CHAR) LEN(4)/* GET THE CURRENT DATE IN YYYYMMDD FORMAT */
     RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&QDATE)
     CVTDAT     DATE(&QDATE) TOVAR(&YYMD) FROMFMT(*SYSVAL) +
                  TOFMT(*YYMD) TOSEP(*NONE)
/* USE THE CEEDAYS API TO CONVERT TO A LILIAN DATE, + ADD 1 DAY. + USE THE CEEDATE API TO CONVERT BACK TO YYYYMMDD */
     CALLPRC PRC(CEEDAYS) PARM(&YYMD 'YYYYMMDD' &LILIAN *OMIT)
     CHGVAR VAR(%BIN(&LILIAN)) VALUE(%BIN(&LILIAN) + 1)
     CALLPRC PRC(CEEDATE) PARM(&LILIAN 'YYYYMMDD' &YYMD *OMIT)
/* SHOW THE RESULT */
     SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) +
                  MSGDTA('Tomorrow will be' *BCAT &YYMD) +
                  MSGTYPE(*COMP)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.