ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

send a message from CL program to the job log

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

  • send a message from CL program to the job log

    How about a technique to send a message from CL program to the job log?

    something like...
    SNDMSG MSG('Critical day end processes finished') TOUSR(JOBLOG)

  • #2
    Re: send a message from CL program to the job log

    You mean like this?

    Code:
                 PGM                                                             
                 DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(80)                     
                 DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)                       
                                                                                 
                 MONMSG     MSGID(CPF0000 MCH0000) EXEC(GOTO CMDLBL(ERROR))      
                                                                                 
                                                                                 
                                                                                 
     ERROR:      RCVMSG     MSGTYPE(*EXCP)  MSGDTA(&MSGDTA) +                    
                              MSGID(&MSGID)                                      
                 MONMSG     MSGID(CPF0000)                                       
                 SNDPGMMSG  MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) +        
                              MSGTYPE(*ESCAPE)                                   
                 MONMSG     MSGID(CPF0000)                                       
                                                                                 
     END:        ENDPGM
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: send a message from CL program to the job log

      yes. that would do it!

      Comment


      • #4
        Re: send a message from CL program to the job log

        Be aware that sending a message type *ESCAPE will end the program.
        Philippe

        Comment


        • #5
          Re: send a message from CL program to the job log

          Here's a sample of what I have used successfully

          SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('SAVE IFS is starting ...') TOPGMQ(*EXT) MSGTYPE(*STATUS)

          Comment

          Working...
          X