Using trace

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 set off 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 that specifying any value for OMQ_TRACE switches the trace facilty on. Even if you set OMQ_TRACE to OFF, trace is still active.

To switch trace off, 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, not just read from, the disk.

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

You must stop MQAX running to change the status of the OMQ_TRACE variable.

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 where the trace file will be written.
SET OMQ_TRACE_PATH = Removes the OMQ_PATH environment variable the current working directory (when ActiveX is started) is used.
ECHO %OMQ_TRACE_PATH% Displays the current setting of the trace directory on Windows.
SET OMQ_TRACE = xxxxxxxx This sets tracing ON. You switch tracing on by putting one or more characters after the '=' sign. For example: SET OMQ_TRACE=yes SET OMQ_TRACE=no. In both of these examples, tracing will be set ON. This is only effective for a single window/session
SET OMQ_TRACE= Sets tracing OFF
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.