× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello everyone,

I'm trying to force an error that will flow through the registered ILE Condition Handler(CEEHDLR).

I've a Condition Handler that we wrote in-house to perform actions to support error diagnosis and communicate errors that occur in our application.

It responds well to CPF msgs and the like, but it ignores SQL errors. I would like to cause the registered Condition Handler to be invoked at will.

I've tried using the QMHSNDPM API to send an escape message expecting this to trigger the Condition Handler with no success.

Using this method seems to be supported by IBM and I refer you to the quote below from the IBM 7.1 site.


IBM i 7.1 Information Center > Programming > Programming languages > ILE Concepts
--------------------------------------------------------------------------------

Exception and Condition Management
This chapter provides additional details on exception handling and condition handling. Before you read this chapter, read the advanced concepts described in Error Handling.
The exception message architecture of the operating system is used to implement both exception handling and condition handling. There are cases in which exception handling and condition handling interact. For example, an ILE condition handler registered with the Register a User-Written Condition Handler (CEEHDLR) bindable API is used to handle an exception message sent with the Send Program Message (QMHSNDPM) API. These interactions are explained in this chapter. The term exception handler is used in this chapter to mean either an operating system exception handler or an ILE condition handler.

The call to the QMHSNDPM API.

D SendEscMsg pr extpgm('QMHSNDPM')
D Esc_MsgID 7 const
D Esc_MsgFile 20 const
D Esc_MsgDta 80 const
D Esc_MsgDtaLen...
D 10i 0 const
D Esc_MsgType 10 const
D Esc_MsgQ 10 const
D Esc_MsgQNbr 10i 0 const
D Esc_MsgKey 4
D Esc_ErrorDS 16

D Esc_ErrorDS ds 16
D Esc_BytesProv...
D 10i 0 inz(16)
D Esc_BytesAvail...
D 10i 0
D Esc_ExceptionID...
D 7

D Esc_MsgDta s 80
D Esc_MsgKey s 4

callp SendEscMsg ('CPF9898':
'QCPFMSG QSYS':
Msg:
%len(Msg):
'*ESCAPE':
'*EXT':
2:
Esc_MsgKey:

What have I done wrong?

Thanks!

Steve Needles

________________________________
This communication, including attachments, is confidential, may be subject to legal privileges, and is intended for the sole use of the addressee. Any use, duplication, disclosure or dissemination of this communication, other than by the addressee, is prohibited. If you have received this communication in error, please notify the sender immediately and delete or destroy this communication and all copies.

TRVDiscDefault::1201

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.