Collecting a trace of a command using JCL

To collect a trace of a Managed File Transfer for z/OS® command that is being submitted using JCL you need to complete the following steps.


Procedure

  1. Locate the data set containing the JCL for the command that needs to be traced.
  2. Within the data set, locate the member for that command.
  3. Edit the member, and locate the line that contains the name of the command that needs to be traced. Modify this line so that it includes the text after the command name and before the + sign:
    -trace classes=level -tracePath directory_path
    where:

    • classes=level is the trace level to use, and which classes to enable trace for. Unless otherwise specified by your IBM® Support Representative, set this to com.ibm.wmqfte=all.
    • directory_path is the USS directory where the trace files will be written to.
  4. Submit the member.
  5. After the issue has been reproduced, edit the member again and remove the text:
    -trace classes=level -tracePath directory_path
    that you added in Step 3.


Results

The resultant trace files are written to the directory specified by the -tracePath parameter.

The trace files are called trace%PID%.txt.number, where:

  • %PID% is the process identifier for the command.
  • number is a sequence number for the trace file. Typically, the trace information generated by a command is contained within a single trace file that has a sequence number of 0.

    However, it is possible that a command will generate a lot of trace information. In this situation, the trace will be written to multiple files. The current trace file has a sequence number of 0, the next oldest trace file has a sequence number of 1, and so on.

Trace output for commands are written to a maximum of five wrapping trace files. The maximum size of each trace file is 20MB.Note: If the user running the command does not have permission to write to the directory specified by the -tracePath parameter, the trace output is written to standard error.


Example

In this example, the member BFGMNLI has been modified to trace the fteListMonitors command:
//********************************************************************
//* <copyright
//* notice="lm-source"
//* pids="5655-MF9"
//* years="2013,2016"
//* crc="3927276320" >
//* Licensed Materials - Property of IBM
//*
//* 5655-MF9
//*
//* (C) Copyright IBM Corp. 2013, 2020 All Rights Reserved.
//* </copyright>
//********************************************************************
//* fteListMonitors
//********************************************************************
//BFGCMD   EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC  DD DSN=++LIBRARY++,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//STDOUT   DD SYSOUT=*
//STDERR   DD SYSOUT=*
//SYSTSIN  DD *
 %BFGCMD CMD=fteListMonitors -trace com.ibm.wmqfte=all -tracePath /u/trace +
    -v -p QM1  
/*
//
When the member is submitted, the fteListMonitors command writes trace to the USS directory /u/trace.