ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Inhibiting status message

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

  • Inhibiting status message

    I just completed writing a CL program which runs in a continuous loop in batch and goes out to a remote system looking for a file on a remote server. The process works great except that each time I issue a Ping statement to verify that the remote system is online, the Ping results show up in the Job Log, which causes the log to get large and eventually wrap. The first thing that I did in an attempt to curtail this is to change the status message for the job to *NONE. Unfortunately that doesn't stop the Ping results from making its way into the Job Log.

    Any ideas on how to inhibit the Ping returns?

  • #2
    I would do it like this:
    after the PING command the first message is TCP3203 ( Verifying connection to host system ...... )

    chgvar &MSGID ' '
    DOWHILE COND(&MSGID *NE 'TCP3203')
    RCVMSG MSGTYPE(*LAST) RMV(*YES) MSGID(&MSGID)
    ENDDO

    Comment


    • #3
      And I guess another option, instead of pinging the remote system to verify that it's up (although responding to a ping doesn't guarantee that it will respond to your data request) is to monitor for connection errors instead.

      Cheers,

      Emmanuel

      Comment


      • #4
        Also take a look at the MSGMODE parameter to the PING utility.

        You probably want something like this:
        Code:
        PING RMTSYS(whatever it is) MSGMODE(*QUIET *ESCAPE)
        Then remove all of the extraneous messages​ in a manner similar to what Peder describes (except that I'd remove more than just TCP3203.)

        Comment


        • Peder Udesen
          Peder Udesen commented
          Editing a comment
          All messages from the last message to the TCP3203 message will be removed using the method I described.
      Working...
      X