Controlling trace for IBM MQ Automation Classes for ActiveX

The IBM® MQ Automation Classes for ActiveX (MQAX) includes a trace facility to help the service organization identify what is happening when you have a problem.

It shows the paths taken when you run your MQAX script. Unless you have a problem, run with tracing disabled to avoid any unnecessary use of system resources.

There are three environment variables that you set to control trace:
  • OMQ_TRACE
  • OMQ_TRACE_PATH
  • OMQ_TRACE_LEVEL
Note: Specifying any value for the OMQ_TRACE variable switches the trace facility on. Even if you set the OMQ_TRACE variable to OFF, trace is still active. To switch off tracing, do not specify a value for OMQ_TRACE.
  1. Click Start
  2. Click Control Panel
  3. Double-click System
  4. Click Advanced
  5. Click Environment
  6. In the section titled User variables for (username), click New
  7. Enter the variable name and a valid value in the appropriate fields and click OK
  8. Click OK to close the Environment Variables window
  9. Click OK to close the System Properties window
  10. Close the Control Panel window

When deciding where you want the trace files written, ensure that you have sufficient authority to write to, as well as read from, the disk.

With tracing enabled, it slows down the running of the MQAX, but it does not affect the performance of your ActiveX or IBM MQ environments. When you no longer need a trace file, you can delete it.

You cannot change the status of the OMQ_TRACE variable while MQAX is running.

Trace file name and directory

The trace file name takes the form OMQnnnnn.trc, where nnnnn is the ID of the ActiveX process running at the time.

Table 1. Commands and their effects
Command Effect
SET OMQ_TRACE_PATH = drive:\directory Sets the trace directory in which the trace file is written.
SET OMQ_TRACE_PATH = Removes any existing setting for the trace directory. When the trace directory is not set, the current working directory (when ActiveX is started) is used.
ECHO %OMQ_TRACE_PATH% Displays the current setting for the trace directory on Windows.
SET OMQ_TRACE = xxxxxxxx Switches on tracing. You enable tracing by putting one or more characters after the '=' sign. For example: SET OMQ_TRACE=yes and SET OMQ_TRACE=no. In both of these examples, tracing is enabled. This setting is only effective for a single window/session.
SET OMQ_TRACE= Switches off tracing.
ECHO %OMQ_TRACE% Displays the contents of the environment variable on Windows.
SET Displays the contents of all the environment variables on Windows.
SET OMQ_TRACE_LEVEL = 9 Sets the trace level to 9. Values greater than 9 do not produce any additional information in the trace file.