Getting the right level of detail in your trace output

You can trace all QMF functions in detail or trace individual QMF functions.

To trace all QMF functions at the most detailed level, use a value of ALL in the TRACE column of the Q.PROFILES table. If the results of this option are too large, you can limit the amount of trace output to a specific size by setting the DSQEC_TRACE_LIMIT global variable.

To trace individual QMF functions, use a different character string in the TRACE column of the Q.PROFILES table. Use letters for the QMF functions you want to trace and a number for the level of trace detail for each function. You must pair each letter with a number as follows:
  • The value 1 traces a function at a medium level of detail.
  • The value 2 traces a function at the highest level of detail.
When you use function-level tracing, only the functions you specify in the character string are traced. The following table shows the letter to use for each QMF function.
Table 1. Function-level trace IDs
Trace ID QMF function that is traced
A Application support services
C Common services and systems interface
D Dialog command processing
E Display services for parts of QMF such as Prompted Query, QBE, Table Editor, global variable lists, and database object lists
F Report formatting
G QBE, Prompted Query, and Table Editor full-screen windows
I Database services
L Message and command logging
P Charting (Interactive Chart Utility)
R Storage management functions
U User exits, such as user edit exit routines or a governor exit routine
For example, to trace message and command logging at the most detailed level, application support services at a medium level, and common services and systems interfaces at the most detailed level, use this command:
SET PROFILE (T=L2A1C2

The value of the TRACE option in the QMF profile is ignored when you start QMF as a Db2® for z/OS® stored procedure. However, you can include a SET PROFILE (TRACE command in the initial procedure specified by the object-name parameter to change the level of trace detail for the duration of the stored procedure session as long as the L2-destination parameter is set to DSQDEBUG. When you issue a SET PROFILE command to change the trace settings, ensure that L2 is among the options specified on the SET PROFILE (TRACE command in the initial procedure if you want to continue tracing messages and commands.

Use the L1 and L2 trace records to precisely record user activities during a QMF session. A value of L1 writes records for all messages that are issued by QMF. L2 writes all the L1 records plus more records that describe the execution of QMF commands. Use the L2 trace code to log each command that a user issued and how QMF responded to that command. The following example of a RUN QUERY command fail because the user names columns that are not in the table.

Figure 1. Using the L2 trace code to trace a user's commands and messages
--------------------------------------------------------------------
----------       ****** 93/12/15  20:39 ******     -----------------
USERID: KRIS
AUTHORIZATION-ID: KRIS
COMMAND TEXT:
RUN QUERY
--------------------------------------------------------------------
--------------------------------------------------------------------
----------       ****** 93/12/15  20:39 ******     -----------------
USERID: KRIS
AUTHORIZATION-ID: KRIS
MESSAGE NUMBER: DSQ12405
MESSAGE TEXT:
Column name DATE is not in table STAFF.
&O1:  DATE
&O2:  STAFF
&O9:  -205
--------------------------------------------------------------------

Within the DSQDEBUG data set, the messages appear chronologically. When commands are included, they also appear chronologically and are intermixed with the messages. A message is associated with the command that precedes it in the data set or file.

QMF messages have variables for parts of the message that change, such as a table or column name. You can use the trace data to help a user decipher a message that includes variables. For example, the message that is shown in the previous example appears in QMF Messages and Codes as: Column &V1 is not in table &V2. The bottom half of the example shows that the value for &V1 in the message is DATE and that the value for &V2 is STAFF. Substitute these values into the message to help a user solve the problem.

These variables might also appear in the definition of the help panels that are associated with the error message. Use the variable values from the trace data together with the HELP command to reconstruct the message help panel if necessary.