0 pts.
 How to use API (QMHRCVPM)
Hi everyone... My first time to this site and I could use some help. I'm trying to use the Receive Program Message API to retrieve an error message that I want to mail to a user. Here's the scenario: Program 1 calls Program 2 calls program 3 calls program 4 Program 4 has an unmonitored message that the operator replies to with a 'C' to cancel. I want to send the text of the error to a user from Program 2. Program 4 is no longer in the stack because it has already been cancelled. How can I retrieve the CPF message from Program 4 and use it in Program 2 ? Thanks for any and all help. Westdeb27

Software/Hardware used:
ASKED: March 17, 2005  11:08 AM
UPDATED: March 23, 2005  4:45 AM

Answer Wiki:
Best thing to do would be to catch the error in program 4 and handle it. If you want program 2 to handle it you can use QMHRSNEM (Resend escape message) to send the escape message up the call stack (either directly or 'bubbling up'; see information about QMHRSNEM). In the scenario you are describing, the exception is handled by the user through the inquiry message. When the user answers 'C'ancel, program 4 is removed from the call stack and program 3 receives a new exception 'Call to program 4 ended in error'. To find the original exception, you would have to examine the job log.
Last Wiki Answer Submitted:  March 23, 2005  4:45 am  by  Joepbeckeringh   0 pts.
All Answer Wiki Contributors:  Joepbeckeringh   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _