Hello All,
I have a question. Here is the scenario:
A job calls PGM A and it in turn calls PGM B.
Note: Both A and B are ILE programs and created with activation group, *CALLER.
PGM A
********
/Free
...................
...................
CallP PGM B (Parm1: Parm2);
Var1 = Parm2;
...................
...................
/End-Free
*********
Is there any API or function or logic that I could use that would enable me to return control back to the line soon after the call to PGM B (i.e. Var1 = Var2).
If there is an error (exception or validation or whatever) in PGM B (or any calls from it), I need to end everything upto and including PGM B "NORMALLY" and return back to A.
I could use CEETREC or C Function Exit(), but I guess that would require me to put PGM B in a separate activation group. Or else, it would end up ending PGM A as well as my main job everytime an error occurs.
Is there an easy solution or am I asking for too much :(
Software/Hardware used:
ASKED:
July 17, 2009 3:19 PM
UPDATED:
July 21, 2009 2:44 PM
To answer the first qn – I need to transfer control back to PGM A (XML parser and composer program) because I need to generate an error CML with appropriate info.
Again, I have handled program exception errors with a *PSSR. But for validation errors also, I need to stop processing and exit out of B. The procedures are deeply nested and hence mere return might not help to end PGM B completely.