Hi,
Convert date command is designed to convert date from one format to other. CVTDAT command can only be used in CL or ILE- CL procedure. This command first checks for a Valid date and then converts the date to other format. It works with QLEAPADJ System value.
Convert date command is designed to convert date from one format to other. CVTDAT command can only be used in CL or ILE- CL procedure. This command first checks for a Valid date and then converts the date to other format. It works with QLEAPADJ System value.
PGM
PARM(&INDATE &VALID)
DCL VAR(&INDATE) TYPE(*CHAR) LEN(6)
DCL VAR(&VALID) TYPE(*CHAR) LEN(1)
DCL VAR(&JUNK) TYPE(*CHAR) LEN(8)
CHGVAR VAR(&VALID) VALUE(Y)
CVTDAT DATE(&INDATE) FROMFMT(*MDY) +
TOVAR(&JUNK) TOFMT(*YYMD) TOSEP(*NONE)
MONMSG MSGID(CPF0550 CPF0551 CPF0552 CPF0553 +
CPF0555 CPF0556 CPF0557) +
EXEC(DO)
CHGVAR VAR(&VALID) VALUE(N)
ENDDO
SNDPGMMSG MSGDTA(&VALID) MSGTYPE(*COMP) MSGF(QCPFMSG) +
MSGID(CPF9897)
ENDPGM
DCL VAR(&INDATE) TYPE(*CHAR) LEN(6)
DCL VAR(&VALID) TYPE(*CHAR) LEN(1)
DCL VAR(&JUNK) TYPE(*CHAR) LEN(8)
CHGVAR VAR(&VALID) VALUE(Y)
CVTDAT DATE(&INDATE) FROMFMT(*MDY) +
TOVAR(&JUNK) TOFMT(*YYMD) TOSEP(*NONE)
MONMSG MSGID(CPF0550 CPF0551 CPF0552 CPF0553 +
CPF0555 CPF0556 CPF0557) +
EXEC(DO)
CHGVAR VAR(&VALID) VALUE(N)
ENDDO
SNDPGMMSG MSGDTA(&VALID) MSGTYPE(*COMP) MSGF(QCPFMSG) +
MSGID(CPF9897)
ENDPGM