|
What's a good way to retrieve the full message or message data associated with a failed call to QCMDEXC ? In the code below at the point labeled ZZZ I would like to have access to the full error message in effect at that time. However, by definition, the exception data in the program status data structure is only available when the status is 9999. In the code below, when commitment control is already active before the call to this program, the new attempt to start commitment control correctly generates a CPF8351 (commit control already active), however it yields a status code = 00202 "Called program or procedure failed". So the exception data is blank (even though the PSDS has the desired message ID of CPF8351). Thanks - Dave K. C *INZSR BegSR * start commitment control C eval cmdStr = 'STRCMTCTL LCKLVL *CHG' C eval cmdLen = %len( cmdStr ) C* the procedure 'command' is a prototyped call to QCMDEXC C callp(e) command(cmdStr : cmdLen) C if %error C* CPF8351 indicates commitment control is already active C if psds_MsgID = 'CPF8351' C rolbk C else C* ZZZ Friendly error handler goes here C endif C endif note: the procedure "command" is defined as follows ... D Command PR ExtPgm('QCMDEXC') D CmdStr 32702 const options(*varsize) D CmdLen 15p 5 const * Program Status Data Structure D psds esds extname(PSDS) prefix(psds_)
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.