|
> From: Denzil D'souza > > Is there a way to kill an entire call sequence at one go? > For example: > ------------ > I have a Program A, calling B which, further calls another program C > Now, lets say a fatal error occurs in Pgm C, on Error (Within the > *PSSR) is it possible to terminate B and A along with > C in an elegant manner? The answer is - it depends <grin>. Do you know which program is at the top? If so, you can send an escape message directly to that program, which will in effect terminate the entire stack. SNDPGMMSG MSGID(&MSGID) MSGF(&MSGF) MSGDTA(&MSGDTA) + TOPGMQ(*PRV (&PGM)) MSGTYPE(*ESCAPE) This sends an escape message to the program that calls &PGM (which could be a menu or the command line). So, if you call A from the command line, if program C encounters an error, it can send it back to A's caller by specifying &PGM as "A", and the error will be returned to the workstation. The hard part sometimes is determining which program is the highest level, especially if A is sometimes the top and B is sometimes the top. Joe
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.