Check the postings here about ending CL programs. It includes a post with code for a standard error routine. -dan
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
RCVMSG and re-send
Collapse
X
-
RCVMSG and re-send
Thanks for the quick response, Dan. Your code example in ending a CL isn't the same as this example. Program C (COBOL or RPG) sends an *INFO message to itself and it appears in the joblog. I want to capture that and re-send it to program A. I also tried Ernie Malaga's FWDPGMMSG without success. Trevor
-
RCVMSG and re-send
Trevor, PGM C (the COBOL programme) should send its *INFO message to the previous *MSGQ or to the *MSG of either PGM A or PGM B. It gets a liitle tricky when it is an ILE PGM, then you have to take the PEP into the count. The moment PGM C ends its *MSGQ is not available for the other PGMs. Regards, Carel Teijgeler.
Comment
-
RCVMSG and re-send
Trevor Lazarus wrote: > Program A calls CL program B that calls > program C that does the task and sends an > info message. It appears in the joblog as > sent to program C. > > What parameters are needed in CL program > B on the RCVMSG to capture the message > from C and send it back up the line to A? As Carel wrote, once C ends, its message queue is gone, too. If the message is truly in the job log, you can use the QMHLJOBL API to retrieve messages from the job log. The normal way to do this is to have C send the message to B, who then re-sends it to A. --buck
Comment
-
RCVMSG and re-send
Program A calls CL program B that calls program C that does the task and sends an info message. It appears in the joblog as sent to program C. What parameters are needed in CL program B on the RCVMSG to capture the message from C and send it back up the line to A? Trevor
Comment
-
RCVMSG and re-send
Use either of these two CL commands if you know teh names of Programs A Or B. in these examples, teh vaiables &PGMA and &PGMB are assumed to hold the names of those programs. (obviously - right?) SNDPGMMSG MSG('TEST') TOPGMQ(*SAME (&PGMA)) SNDPGMMSG MSG('TEST') TOPGMQ(*PRV (&PGMB)) Use a call to the API if you don't know the names. You can reference a relative call stack entry.
Comment
Comment