Hey Friends
I am using QSH to update a physical file in my CLLE program. I am trying to trap the error message whenever the update statement fails.But I am not able to trap the error message.
Please see the code sample below:
In the above statement , I am trying to update a numeric field with Character value so that the SQL statement would fail and I can trap that error but eventhough the SQL statement fails in QSH, the error is not sent to my CLLE so I could not handle that error.
Your help is greatly appreciated.
Thank You
Regards
Nanda...
I am using QSH to update a physical file in my CLLE program. I am trying to trap the error message whenever the update statement fails.But I am not able to trap the error message.
Please see the code sample below:
Code:
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(4)
DCL VAR(&DATE) TYPE(*CHAR) LEN(6)
DCL VAR(&CMD) TYPE(*CHAR) LEN(100) VALUE('db2 +
"update mylib/myfile set numfield = +
ABCDEF"')
CHGENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) VALUE('Y')
MONMSG MSGID(CPFA981) EXEC(DO)
ADDENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) VALUE('Y')
ENDDO
CHGENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) VALUE('NONE')
MONMSG MSGID(CPFA981) EXEC(DO)
ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) VALUE('NONE')
ENDDO
QSH CMD(&CMD)
MONMSG MSGID(QSH0005 QSH0006 QSH0007) EXEC(DO)
SNDPGMMSG MSG('Update to file MYFILE failed') +
TOUSR(MYPROF)
ENDDO
RMVENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT)
RMVENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG)
ENDPGM
Your help is greatly appreciated.
Thank You
Regards
Nanda...







Comment