× 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.



Doc,

What you are asking for is doable, and on a one time basis is not too much
work.

I asked a similar question a few weeks ago and Simon responded like so:

>You can do this using the ILE Condition Handler APIs. Conditions are a
>platform independent way of handling exceptions and mapp to AS/400
>exception messages. You write a procedure to handle the condition then you
call
>CEEHNDLR to register your interest in the condition. There are a heap of
>APIs to manage conditions. See the ILE CEE API section of the
>pseudo-information centre.

I did some reading on the subject ( but did not actually test it ) and what
follows is what I posted as a reply.  Hope it helps.

Steve Richter

------------------------------------------------

Ok, I have done the reading and I think I understand how condition handler
APIs work.  This link explains them pretty well.

http://www.midrangeserver.com/mpo/mpo081502-story05.html

Basically a condition handler proc is registered to handle ALL signaled
conditions of a call stack entry ( running of a proc ).

When the condition handler is registered ( CEEHDLR ) a pointer to error code
data struct in the registering proc is provided.

When a condition is signaled ( CEESGL ) to a call stack entry the associated
registered condition handling proc is called. The cond handler proc
interprets the error id ( token ) and either
  - sets the error code variable and returns RESUME or
  - returns PERCOLATE or PROMOTE when the exception ( condition ) is not
handled.

It looks like an *Escape message send to a call stack entry auto signals a
corresponding condition.

So putting aside the condition handler proc, the running/monitoring proc
does the following:
  RegisterHandler( pHandlerProc: %addr(ErrorData) ) ;

  DoSomethinProc( a: b: c ) ;
  select ;
  when    ErrorData.MsgId = 'ABC0010' ;
  when    ErrorData.MsgId = 'ABC0020' ;
  endsl ;

  UnRegisterHandler( ... ) ;




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.