Hello all. I seem to be having a problem with handing error messages that are to be written to the subfile error message record. A small CL program is being called by the RPG to send a specified error message to the screen (using a string, not a message file). Here is the CL:
I'm using a Monitor block in the RPG to handle an error when checking a date. I move the display file date input field (character field) into an internal date field; on-error, call the CL with the message text. It's adding the message to the error message subfile, however it is first putting a system error message saying "Date, Time or Timestamp value is not valid." So essentially it’s writing two error messages instead of just the one that I sent to the CL. How can I keep this command from writing the system message and only write the message I specify?
Code:
PGM PARM(&SFPGMQ &MSGTXT)
DCL VAR(&SFPGMQ) TYPE(*CHAR) LEN(10)
DCL VAR(&MSGTXT) TYPE(*CHAR) LEN(512)
SNDPGMMSG MSG(&MSGTXT) TOPGMQ(*SAME (&SFPGMQ))
MONMSG MSGID(CPF0000)
ENDPGM
I'm using a Monitor block in the RPG to handle an error when checking a date. I move the display file date input field (character field) into an internal date field; on-error, call the CL with the message text. It's adding the message to the error message subfile, however it is first putting a system error message saying "Date, Time or Timestamp value is not valid." So essentially it’s writing two error messages instead of just the one that I sent to the CL. How can I keep this command from writing the system message and only write the message I specify?