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



I just put something in place where I MONITOR for errors and use a procedure
to explain the error and send out an email.  I have a control file that
people may enter a program name and some text that will appear in an email
if that program runs into an error.  It's just a very basic routine, but it
allows for the program to continue on and let me know if an error has taken
place.  I pass the program data structure as a parm to the procedure.  I've
seen similar routines here using the *PSSR.


-----Original Message-----
From: Buck Calabro [mailto:Buck.Calabro@commsoft.net]
Sent: Monday, November 25, 2002 12:18 PM
To: rpg400-l@midrange.com
Subject: RE: File Exception/Error Subroutine - INFSR


>*every*, I/O operation involving a data
>file is checked with %error.
-snip-
>I just would desire to "hide" the code in a
>faraway routine
-snip-
>Does anyone have practical experience using INFSRs?

Yes.  They are great for catching unexpected errors (like object damage),
doing a post-mortem DUMP and exiting with an error code set so the caller
can handle the fact that this program failed.  Great for commitment control.

As you note, you can't resume at the point of failure.  For more information
on that, check the MONITOR operation.  This very list had a thread on this
topic not too long ago.

Whatever you decide to do, I might argue that you should keep the I/O and
it's error handling together.  To me, that means wrapping the I/O in either
a subr call or a procedure call.  I prefer a subr because it is very clear
to me that subrs deal with global variables (like file fields.)
  --buck
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.