Use the watch for event function

Start of changeUse the corresponding commands to set up and use the watch for event function.End of change

Start Watch (STRWCH) command

The Start Watch (STRWCH) command starts a watch session and notifies you when the specified message or Licensed Internal Code log entry occurs. When the watched for message is added to the specified message queue or log, or the watched for log entry is added, the exit program specified in the Watch program (WCHPGM) parameter is called.

Start of changeWhen watching for messages, you must specify the message queue or job log where you expect the message to be sent. You can narrow the search by specifying a text string to be compared against the message data, the From program or the To program of the watched for message.End of change

Start of changeWhen watching for Licensed Internal Code log entries, you must specify the Licensed Internal Code log major and minor codes. *ALL and wildcards (?) are accepted. You can narrow the search by specifying a text string to be compared against several of the Licensed Internal Code log fields of the watched for log entry. Use the Watch for Licensed Internal Code log entry (WCHLICLOG) parameter on the STRWCH command.End of change

Start of change

Work with Watches (WRKWCH) command

The Work with Watches (WRKWCH) command is used to show a panel with a list of active watches on the system.

End of change
Start of change

End Watch (ENDWCH) command

The End Watch (ENDWCH) command is used to end a watch session.

End of change
Start of change

Start Watch (QSCSWCH) and End Watch (QSCEWCH) APIs

The Start Watch (QSCSWCH) and End Watch (QSCEWCH) application programming interfaces (APIs) have a very similar usage to the STRWCH and ENDWCH commands.

End of change
Start of change

Use the watch for event function with trace commands

Watch support enhances the trace functions by automatically monitoring and ending traces when certain predetermined criteria are met. This prevents the loss of valuable trace data and reduces the amount of time that you need to spend monitoring traces. For more information, see Advanced trace function: Watch support.

End of change
Related information
Exit Program for Watch for Event
Start Watch (STRWCH)