Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

RCVMSG and re-send

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RCVMSG and re-send

    Check the postings here about ending CL programs. It includes a post with code for a standard error routine. -dan

  • #2
    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

    Comment


    • #3
      RCVMSG and re-send

      Trevor, For *INFO messages, offhand I can't think of a way other than DSPJOBLOG to an *outfile and find it there. Not very elegant, though. Maybe someone else has a better idea. -dan

      Comment


      • #4
        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


        • #5
          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


          • #6
            RCVMSG and re-send

            Trevor, If the message is in the Job Log, then it should be in the External Message Queue (*EXT). Would something like the (only slightly tested) code below work for you? Mike
            Code

            Comment


            • #7
              RCVMSG and re-send

              Thanks for the replies. I was hoping the programs inability to capture the message with RCVMSG was due to my mismatching of different parameters on the RCVMSG command. looks like I'll have to resort to using the APIs. Trevor

              Comment


              • #8
                RCVMSG and re-send

                Trevor, Is there a problem with modifying Program C to send its message to Program A? Kevin

                Comment


                • #9
                  RCVMSG and re-send

                  Yes Ken, that's what I eventually did. After mucking with Ernie Malaga's FWDPGMMSG and getting nowhere, I changed C to send to B and then re-send it back to A. Trevor

                  Comment


                  • #10
                    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


                    • #11
                      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

                      Working...
                      X