|
David wrote: > > Does anyone know whether there is anywhere an example showing how to use > "monitor; ... endmon;" block to catch any error messages and then use > the "select" block to either resume, promote the message to my own, or > just let it percolate to the default error handler? I did not find any > example on how to "promote" an error message. > > I read about condition handlers, but if I can have the same with > "monitor" this would be my preferred way, as it seems to be both easier > to code and more readable. > MONITOR doesn't provide all the same functions as condition handlers. Using MONITOR, you can choose which status codes to monitor for by coding one or more ON-ERROR statements. But once you are in an ON-ERROR, the message has already been handled, and you can't promote it. You could receive the message in the ON-ERROR, and then issue a different one of your own, but the "from pgm" of the new message would be your MONITOR program, and not the original frompgm. The promote feature of condition handlers is nice, but as far as I know, it doesn't give the opportunity to provide replacement text for the promoted message.
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.