× 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 Steve,

You wrote:
>I want to use the MONITOR opcode in a CL like way, that is monitor for
>specific exception message identifiers.

You cannot do that. I asked George Farr about getting MONITOR to do exactly 
that when he was out here a number of years ago (MONITOR was being presented 
as part of the then upcoming new release of RPG IV) and my request didn't 
seem to make an impression as useful -- perhaps too much work for the 
compiler team or MONITOR was closer to implementation than we were lead to 
believe.

>Is there a way to map exception identifiers to the actual msgid that 
>signaled the exception?

In many cases the real message is still in the joblog so you could attempt 
to retrieve it. You will also find that the Program Status Data Structure 
(PSDS) or File Feedback Data Structure (INFDS) contains the message ID (and 
text) of the message that caused the exception. Note that many (20 or so) of 
the RPG status codes are not caused by an exception and therefore the 
message ID fields will either be blank or contain the previous exception 
information.

>Basically I want a proc to throw an exception and the calling proc to catch
>it.

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. 

>How does my code throw an rpg exception identifier?

What do you mean? Any exception message sent by your code will be caught by 
RPG -- either via an indicator, built-in function (e.g., %ERROR), or the 
default exception handler. If you want to send a specific RPG error message 
then look at the RPG message files.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists       
                                                                  
   http://www.flybynight.com.au/                                  
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                                                             X    
                 ASCII Ribbon campaign against HTML E-Mail  / \   
--------------------------------------------------------------------


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.