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



Hi Steve,

>Buck, I dont see "QRNXMSG" mentioned in the archives.  
>Did that thread pertain to where to send an *escape 
>msg using qmhsndpm?

No, my problem was "How do I force a program to abend?"  But it involved
sending an escape message up the stack with QMHSNDPM.  I threw in the
QRNXMSG because that's where RPG stores it's messages, and I thought it
might be helpful in the archives.  Sorry to make a mess.

>From my testing, all *escape messages sent to a procedure 
>call stack entry result in error number 202. And the 
>pgm status data struct contains the msgid of the msg.
>
>The problem with this is that all errors are covered 
>by the 202 error code. And that kind of defeats the 
>purpose of "exception" handling.  

Well, sort of.  The way most OS/400 processes do this is to send up some
diagnostics, then the escape message.  It's up to the message handler to
read the diagnostics.  I understand where you're coming from: it isn't the
same as other platforms.

>Is there a way for an ile proc to signal an 
>error number based exception.

In my own stuff, I don't actually throw escape messages to the caller.
Rather, I set a return code that the caller needs to inspect.  I stick my
return codes in a /COPY member and refer to them via mnemonics rather than
by number.  I'm not sure if this helps or not...

eval rc = validateCustomer(custID)
if rc < 0 ...

  validateCustomer
  ...
  if not %found
  eval rc = NORECORD
  endif
  ...
  return rc

  --buck

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.