ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Auto reply to messages

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

  • Auto reply to messages

    Ok - I have a challenge that is likely very easy and one of those many "Well, duh!" moments I have.

    To test something I have two CLLE programs.

    The first one - TESTJOB1:

    Code:
                 PGM   
                 SBMJOB     CMD(CALL PGM(TESTJOB2)) JOB(TESTJOB2) +    
                              INQMSGRPY(*RQD)                          
                  ENDPGM
    Pretty straightforward - just submit a job that calls TESTJOB2.

    TESTJOB2 is:
    Code:
    PGM                      
    CALL       PGM(PGMX)     
    endpgm
    Program PGMX doesn't exist - if I do a call to TESTJOB2 I get the expected 'CPF0001 received by procedure TESTJOB2 (C D I R) . Joblog shows message CPD0170 indicating that program PGMX was not found.

    Now if I do a call to TESTJOB1 it submits the job, the job ends abnormally, QSYSOPR shows the message CPF0001 with an autoreply of 'C'.

    I don't want it to auto reply - I want it to show me the error and make me reply to it. My job description has INQMSGRPY(*RQD) - and that is also specified in the SBMJOB command above.

    What am I missing?

  • #2
    did you look in WRKRPYLE?

    Comment


    • #3
      Yes - there aren't any CPF messages in there at all - and that's what I thought the INQMSGRPY(*RQD) was supposed to do anyway - ignore the reply list entries????

      Comment


      • #4
        There are only 2 entries in WRKPYLE that have a reply of 'C' - CPA4072 for QSYSPRT - this deals with maximum # of records reached. The other is CPA5737 that is for the IBM Support dialup that isn't used anymore.

        Comment


        • #5
          You need to make a distinction between a job that has a terminal attached to it (commonly referred to as an "interactive" job) and a job that does not have a terminal connected to it (called a "batch" job.)

          When you run SBMJOB, it creates a batch job. Any messages that occur in that job cannot be sent to your display because it is not connected to your display -- it is not connected to any display. That is the nature of a batch job. Instead, error messages are sent to the QSYSOPR message queue. (You can also find them with the various WRKxxxJOB commands, etc.)

          You are specifying INQMSGRPY(*RQD), which means that a reply to an inquiry message is required (i.e. the system reply list won't be used, and the system won't automatically respond with a default answer -- a person HAS to reply to the message.) That means that a person will need to check QSYSOPR or WRKxxxJOB or similar in order to find the message and answer it. It does NOT mean that it will come up on your display. Remember, as far as the system is concerned, anything you submit with SBMJOB isn't connected to your display -- so it will never pop up a message on that display.

          Comment


          • #6
            Scott,

            I know that it won't come up in my display - not expecting it to. I want it to show in QSYSOPR - and it does... with C replied automatically.

            Comment


            • #7
              The only way that I can duplicate the same behavior that you describe is if the QSYSOPR message queue is in default (*DFT) delivery mode. You can view the delivery mode at the top right side of the DSPMSG command display.

              Comment


              • #8
                Brian,

                That's it. I've worked on this system since it's beginning in 1988 and never realized that feature...

                Thank you!
                Rocky

                Comment


                • #9
                  Originally posted by Brian Rusch View Post
                  The only way that I can duplicate the same behavior that you describe is if the QSYSOPR message queue is in default (*DFT) delivery mode. You can view the delivery mode at the top right side of the DSPMSG command display.
                  I have a few auto replies set up for CPA4072 and it worked great for years. All of a sudden, the auto replies didn't work and this solved the problem.

                  QSYSOPR message queue DLVRY was *HOLD, it must have been changed when we did an upgrade a couple of weeks ago.

                  Thanks !



                  Comment

                  Working...
                  X