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


  • Subject: RE: Open Source discussion on error handling was: RPGIII/RPG400 ERRORMONITORING
  • From: Buck Calabro <buck.calabro@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 9 Feb 2000 13:34:15 -0500

Leslie wrote:

>You can monitor STSCODE for a value other than 00000 !
>00102 is a divide by zero error, just monitor for it and call 
>your error handler.

If you do not have a *PSSR defined a divide by zero will issue a white
message.  You cannot "trap/monitor" in RPGIII unless you have a *PSSR.  

>With *PSSR there is not really much choice, either let 
>RPG default handler take over or code it to return to 
>some point in the fixed logic cycle.

That's what this thread should be about.  What is the best way to leave the
*PSSR and "continue"?  I posted a clumsy solution that involved each routine
identifying itself.  If an error occurs in that routine, control passes to
the global *PSSR, which returns control to the top of the code.  At the top
is a series of GOTO statements that direct operation to "the next line"
based on the identification of the failing routine.

>No matter what you do to trap the error (there are as 
>many ways, as errors) each error could require radically 
>different methods to correct.

This should be part of the discussion as well.  "What sort of errors can be
encountered?"  Some errors can be avoided altogether by programming
standards: Check every DIV to be sure you don't divide by zero.  Check every
array reference to be sure you're within bounds, put an I/O error indicator
on every I/O statement, UC all your files to be able to trap errors at OPEN,
put error indicators on all CALL statements.  But certain classes of errors
cannot be trapped _where they occur_  You have to use the *PSSR to trap
them.  Perhaps the main example of this is the decimal data error.

So.
The question of the moment is: Does the work required to use the *PSSR
outweigh it's usefulness?  Or is there a better way to "continue after
error" in RPG III?

Buck

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.