Scenario: Using watch support with a job trace

 

Assume that you write a sockets server application that occasionally fails. When the application fails, the TCP3B04 socket API error is sent to the job log. To solve the problem, you need to perform a job trace using watch support.

With watch support, the trace is automatically stopped when the TCP3B04 error is sent to the job log. This allows you to capture only the data that you need to analyze the problem and prevents the trace from running longer than necessary.

To perform the job trace using watch support, follow these steps:

  1. Start the job trace:

    1. At the command line, type STRTRC and press F4.
    2. For the Session ID prompt, specify a meaningful session identifier, such as mytrace.
    3. For the Jobs parameter, specify these values:

      • For the Jobs, Job Name prompt, type the job name, such as SOCKETAPP.

      • For the Jobs, User prompt, specify the user ID, such as user.

      • For the Jobs, Number prompt, type *ALL.
    4. For the Watch for message, Message identifier prompt, type TCP3B04.
    5. For the Watched message queue, Message queue prompt, type *JOBLOG. This ensures that the job trace stops running when the TCP3B04 message is sent to the job log.
    6. For the Watched job parameter, specify these values:

      • For the Jobs, Job Name prompt, type SOCKETAPP.

      • For the Jobs, User prompt, specify the user ID, such as user.

      • For the Jobs, Number prompt, type *ALL.

  2. Verify that the watch support started:

    1. At the command line, type WRKWCH and press F4.

    2. For the Watch prompt, type *TRCCMD. You should see QSCSTTxxxx session listed under Trace type. Note that STT in the middle of the session identifier indicates that the watch session was started by the STRTRC command. xxxx indicates a unique identifier for the watch session.

  3. Verify that the watch support is running:

  4. After the TCP3B04 message is sent to the jobnumber/user/SOCKETAPP job log, you should verify that the trace has ended:

  5. Format the trace output using the Print Trace (PRTTRC) command to analyze the data you collected.

 

Parent topic:

Scenarios: Using watch support with traces