How to use API (QMHRCVPM)

pts.
Tags:
Development
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following