[IBMi]

Using trace on IBM MQ client on IBM i

On IBM® i, there is no Control Language (CL) command to capture the trace when using a standalone IBM MQ MQI client. STRMQTRC and ENDMQTRC programs can be used to enable and disable the trace.

Example for start trace:

CALL PGM(QMQM/STRMQTRC) PARM('-e' '-t' 'all' '-t' 'detail')
Where -e option requests early tracing of all the process -t option for trace type
To end the trace

CALL PGM(QMQM/ENDMQTRC) PARM('-e')
  • Optional parameters:
    -t TraceType
    The points to trace and the amount of trace detail to record. By default all trace points are enabled and a default-detail trace is generated.
    Alternatively, you can supply one or more of the options in Table 1. For each TraceType value you specify, including -t all, specify either -t parms or -t detail to obtain the appropriate level of trace detail. If you do not specify either -t parms or -t detail for any particular trace type, only a default-detail trace is generated for that trace type.
    If you supply multiple trace types, each must have its own -t flag. You can include any number of -t flags, if each has a valid trace type associated with it.
    It is not an error to specify the same trace type on multiple -t flags.
    See the following table for allowed values for TraceType.
    Table 1. TraceType values
    Value Description
    all Output data for every trace point in the system (the default). Using all activates tracing at default detail level.
    api Output data for trace points associated with the message queue interface (MQI) and major queue manager components.
    commentary Output data for trace points associated with comments in the IBM MQ components.
    comms Output data for trace points associated with data flowing over communications networks.
    csdata Output data for trace points associated with internal data buffers in common services.
    csflows Output data for trace points associated with processing flow in common services.
    detail Activate tracing at high-detail level for flow processing trace points.
    lqmdata Output data for trace points associated with internal data buffers in the local queue manager.
    lqmflows Output data for trace points associated with processing flow in the local queue manager.
    otherdata Output data for trace points associated with internal data buffers in other components.
    otherflows Output data for trace points associated with processing flow in other components.
    parms Activate tracing at default-detail level for flow processing trace points.
    remotedata Output data for trace points associated with internal data buffers in the communications component.
    remoteflows Output data for trace points associated with processing flow in the communications component.
    servicedata Output data for trace points associated with internal data buffers in the service component.
    serviceflows Output data for trace points associated with processing flow in the service component.
    versiondata Output data for trace points associated with the version of IBM MQ running.
    -x TraceType
    The points not to trace. By default all trace points are enabled and a default-detail trace is generated. The TraceType values you can specify are the same as the values listed for the -t flag in Table 1.
    You can use the -x flag with TraceType values to exclude those trace points you do not want to record. Excluding specified trace points is useful in reducing the amount of trace produced.
    If you supply multiple trace types, each must have its own -x flag. You can include any number of -x flags, if each has a valid TraceType associated with it.
    -s
    Reports the tracing options that are currently in effect. You must use this parameter on its own with no other parameters.
    A limited number of slots are available for storing trace commands. When all slots are in use, then no more trace commands can be accepted unless they replace an existing slot. Slot numbers are not fixed, so if the command in slot number 0 is removed, for example by an endmqtrc command, then all the other slots move up, with slot 1 becoming slot 0, for example. An asterisk (*) in a field means that no value is defined, and is equivalent to the asterisk wildcard.
    -l MaxSize
    The maximum size of a trace file ( AMQppppp.qq.TRC ) in megabytes (MB). For example, if you specify a MaxSize of 1, the size of the trace is limited to 1 MB.
    When a trace file reaches the specified maximum, it is renamed to AMQppppp.qq.TRS and a new AMQppppp.qq.TRC file is started. If a previous copy of an AMQppppp.qq.TRS file exists, it is deleted.
    The highest value that MaxSize can be is 2048 MB.
    -e
    Requests early tracing of all processes

    For more details see the strmqtrc command

  • To end the trace:
    
    /QSYS.LIB/QMQM.LIB/ENDMQTRC.PGM [-e] [-a]
    
    where:
    -e
    Ends early tracing of all processes.
    Using endmqtrc with no parameters has the same effect as endmqtrc -e. You cannot specify the -e flag with the -m flag, the -i flag, or the -p flag.
    -a
    Ends all tracing.

    For more details see the endmqtrc endmqtrc command

  • To display a formatted trace file:
    
    /QSYS.LIB/QMQM.LIB/DSPMQTRC.pgm
    

To examine FFST files, see the First Failure Support Technology ( FFST ) for IBM MQ for IBM i.