|
Hi James, <snip> Quick question: Suppose, in an RPGLE program, I want to catch, and ignore, a "Status 1024" exception (error in "after" trigger) on a particular UPDATE statement, but I want to throw any other exceptions on that UPDATE back to the operating system. Is there an easy way to do that? </snip> The best way to do handle that in RPG is to use a condition handler. To do this you simply register a procedure with the OS to handle unhandled exceptions. You do this when you initialise your program. When an exception occurs that is not handled the ILE runtime condition manager will call that proc and pass it a condition token (describing the error). In that proc you can do whatever you want. You can "handle" a particular error and allow your program to carry on, or you can "percolate" it (let the OS handle it) and everything will work as before. This is vastly superior to (E) extenders or error indicators or *PSSR/*INFSR subroutines or the monitor op-code. Condition handlers do what everybody wishes monitor did - selectively "handle" only the errors you are interested in and let the runtime worry about the others. Almost all of our interactive programs are covered in this way - and our users never get a message on a screen when an error occurs because our condition handler procedure provides them with a different (user-friendly) one asking them to call helpdesk. Only helpdesk can provide a response to the error so users never cancel out when an error occurs. It works an absolute treat. Have a look at CEEHDLR and CEEHLDU in the iSeries API finder. Cheers Larry
As an Amazon Associate we earn from qualifying purchases.
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.