ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problem with removing completion messages from joblog

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

  • Problem with removing completion messages from joblog

    I have a CL program, part of logic goes like below -

    OPNDBF FILE(&USRLIB/FILE) OPTION(*ALL)
    MONMSG MSGID(CPF4174) EXEC(DO) /* If already open, close and reopen */
    CLOF OPNID(FLDSPF100)
    OPNDBF FILE(&USRLIB/FILE) OPTION(*ALL)
    ENDDO
    RCVMSG MSGTYPE(*COMP) /* remove CPF message */

    Assume that the file is already open. So, when i do OPNDBF, i get CPF4174 and MONMSG handles that. It closes the file and performs OPNDBF again. Now, this generates a completion message in job log as below -

    Member Filename file Filename in Library opened.

    However, i am performing a RCVMSG COMP type at the end. I expect this to remove the above message from job log. But, thats not happening. At the end of the program call, the message remains in the job log.

    What am I missing here? Does this depend on the compilation parameter or job log security level, etc?

  • #2
    Use DSPJOBLOG to find the message. Put the cursor on it and press F1 for the message details, then F9 to see which program queue it was sent to.

    Make sure the RCVMSG is reading that same queue. If not, it won't be able to receive itl

    Comment


    • #3
      Hi Scott, My issue is, I have 2 programs performing below set of tasks on different files -

      OPNDBF FILE(&USRLIB/FILE) OPTION(*ALL)
      MONMSG MSGID(CPF4174) EXEC(DO) /* If already open, close and reopen */
      CLOF OPNID(FLDSPF100)
      OPNDBF FILE(&USRLIB/FILE) OPTION(*ALL)
      ENDDO
      RCVMSG MSGTYPE(*COMP) /* remove CPF message */

      First program:
      OPNDBF is successful and i get a completion message in job log that "File in library opened". This program does not enter MONMSG part and at the end, RCVMSG takes care of removing the completion message from joblog.

      Second program:
      OPNDBF is not successful as the file is already open. This program enters MONMSG part inside which i get a completion message in job log that "File in library opened" and at the end, RCVMSG does not remove completion message from joblog.

      So, why this difference? Is MONMSG the deciding factor or should i check any compilation parameter, etc?

      Comment

      Working...
      X