You control the trace formatter by supplying control statements that identify the trace output file. The trace output file can be on tape or disk. If the file is on disk it might be managed by the VSE/VSAM Space Management for SAM Feature, or it might be a standalone SAM file.
Following is an example of job control to invoke the trace formatter. This example contains a DUMPALL parameter. DUMPALL causes the trace formatter to display on SYSLST all the trace records from the trace file. In the example, the tape is mounted on the virtual address 181, and the file ID is "FORMATTER". The ASSGN statement for a trace tape file must always specify SYS004 as the symbolic unit.
// JOB TRACEJOB // TLBL ARITRAC,'FORMATTER' // ASSGN SYS004,181 // EXEC ARIMTRA,SIZE=AUTO DUMPALL /* /& |
Your job control statements will differ when the trace file is on disk. If your trace output file is on disk, specify the trace formatter DISK control statement. If you are using both DISK and DUMPALL, DISK must precede DUMPALL.
Following are three examples of starting the trace formatter. The examples show how to run the trace formatter when the trace output is:
The formatter examples work with the corresponding DB2 Server for VSE trace examples shown in Specifying Job Control for a DB2 Server for VSE Trace.
The following is an example of the job control required to invoke the trace formatter when the trace output file is on tape.
// JOB RUN TRACE FORMATTER
// TLBL ARITRAC,file-id <-- File-id of trace tape (optional)
// ASSGN SYS004,cuu Address of tape unit
// EXEC ARIMTRA,SIZE=AUTO
*
control statements for trace formatter
*
/*
/&
|
Notes:
The following is an example of the job control required to run the trace formatter when the trace output file resides on DASD and is not VSAM-managed.
// JOB RUN TRACE FORMATTER
// DLBL ARITRAC,'TRACE.FILE1'
// EXTENT ,VSER01,1,0,301,120
// ASSGN SYS006,195
// EXEC ARIMTRA,SIZE=AUTO
DISK
*
other control statements for trace formatter
*
/*
/&
|
Notes:
The following is an example of the job control required to run the trace formatter when the trace output file resides on DASD and is managed by the VSE/VSAM Space Management for SAM Feature.
// JOB RUN TRACE FORMATTER
// DLBL ARITRAC,'TRACE.FILE1',0,VSAM,DISP=(,DELETE)
// EXEC ARIMTRA,SIZE=AUTO
DISK
*
other control statements for trace formatter
*
/*
/&
|
Notes:
COMP and SUBCOMP have been updated for DSC.
Control statements for the trace formatter select the trace records to be printed. The control statements are identified by these keywords:
AGENTNO HEADER COMP RETCODE DATE SUBCOMP DBNAME TIME DISK (VSE Only) TRACENO DUMPALL USERID EXTLUWID
In general, each keyword takes one or more parameters. Each parameter is separated by one or more blanks. Do not use commas to separate the parameters. Each control statement can contain only one keyword, in columns 1 to 71 inclusive, with no continuations. You can supply the control statements in any order. Do not place blank control statements in the input to the trace formatter in DB2 Server for VSE; and do not place blank records in the control statement file, SQLTRFMT SQLTRACE in DB2 Server for VM.
The purpose and syntax of each keyword is described as follows:
Certain agent numbers are fixed:
If TCP/IP support is active, agent 4 is the TCP/IP agent, and higher numbers are user agents. If TCP/IP support is not active, agent 4 and higher numbers are user agents.
If the AGENTNO keyword is omitted, agent number values are not considered in choosing trace records to be formatted.
If the COMP keyword is omitted, the component that the trace record describes is not considered in choosing trace records to be formatted. The COMP keyword should not be used with the SUBCOMP keyword.
If the date statement is omitted, the date is not considered in choosing trace records to be formatted.
Notes:
If you omit the server name, server name values are not considered when you choose records to be formatted.
If the DISK keyword is omitted, the trace input file is assumed to be a tape file.
P Positive (Nonzero) Return Codes Only N Negative Return Codes Only * All Nonzero Return Codes
If the RETCODE keyword is chosen, only trace point records with return codes of the specified value are chosen for formatting. If the RETCODE keyword is omitted, the return codes are not considered in choosing trace records to be formatted.
For DBSS:
DC Data Control DM Data Manipulation ENTRY DBSS Entry Calls EXIT Returns to RDS from DBSS Entry Calls INDEX Index LOCK Lock Management LOG Log/Recovery Management LUW Logical Unit of Work Management SORT Sort STAT Update Statistics STOR Storage Management
For RDS:
AG Access Generator EXEC Executive INT Interpreter and Authorization OPT Optimizer PA Parser AU Security Audit Trace SG Statement Generator
For DRRM:
DICT DDM/FD:OCA Dictionary and FD:OCA descriptors and data GEN DDM Generator PARSE DDM Parser RDIIN RDIIN Manager
For DSC:
AGENT Agent handling (data stream trace) COM Communications
For RA:
RA Resource Adapter Control Flow COM Communications
The SUBCOMP keyword enables you to list the specific subcomponents to be traced. Subcomponents can be specified in any order, each separated by one or more blanks. Up to eight subcomponents can be specified. If the SUBCOMP keyword is omitted, subcomponents are not considered in choosing trace records to be formatted.
The COMP keyword should not be used with the SUBCOMP keyword.
Specifying a time interval that passes through midnight must be done in two different runs of the trace formatter.
It is possible to specify only one time with the TIME keyword. For example, TIME 12:00:00 specifies that only the trace records created during that second of time be formatted.
If TIME is omitted, the time value is not considered in choosing trace records to be formatted.
If the TRACENO keyword is omitted, trace point numbers are not considered in choosing trace records to be formatted.
Certain authorization IDs are fixed:
If the USERID keyword is omitted, authorization ID values are not considered in choosing trace records to be formatted.
The following example demonstrates the use of trace formatter keywords. Note the following characteristics:
Component: RDS component Subcomponent: Parser Trace Numbers: 4400, 4401, 4402 Date of Creation: March 11, 1988 Time of Creation: Between 9:12:00 AM and 1:12:00 PM Agent Number: 4 User: JOHNDOE
To print a listing from the trace file for all the trace records that have these characteristics, the input control statements to the trace formatter will be as follows:
TRACENO 4400 4401 4402 DATE 03/11/88 TIME 09:12:00 13:12:00 AGENTNO 4 USERID JOHNDOE
| Note: | The control statements can be placed in any order. Because the trace-point numbers are known, the COMP and SUBCOMP keywords are not required. |
Each time a trace point is encountered in a function or subcomponent that is activated for trace and the agent or authorization ID is active for trace, trace-point output is produced.
The first printed line is the Trace Header and it has the following format:
While other components may be listed on this line, their opcodes will always be zero.
The RDS OPCODEs come from the RDIIN control block on external calls to RDS in RDIIN field RDICTYPE. RDS places the OPCODE in field RDAOPCOD in the RDAREA control block for trace and for problem determination.
The DBSS OPCODEs, excluding special OPCODEs as described in the following paragraphs, originate from DBSS interface (DBSI) calls as the OPCODE parameter. These DBSS OPCODEs are placed in field YT1OPCOD in the YTABLE1 control block for trace and for problem determination.
Certain DBSS functions are executed without formal DBSI calls to the agent that executes that function. In YT1OPCOD, DBSS sets special pseudo-OPCODEs to cover a number of these situations as follows:
| Note: | For STG tracing, some trace points will have agent=0 for the PROTOTYP. |
If TCP/IP support is active, agent 4 is always the TCP/IP agent and then agents 5 through n are the user agents, where n is the NCUSERS parameter value plus four.
For both level 1 and 2 tracing, except for DBSS entry and DBSS exit trace points, the trace header is always followed by:
MOD_CALLED='entry point name'
MOD_RETURNED='module name' (followed by) RETCODE=---n...n (present if module passed a return code)
MOD_REPORT='module name'
For both level 1 and 2 tracing for DBSS entry trace points, the trace header is always followed by:
DBSS ENTRY: L_OPCODE='DBSS-opcode-name'
For both level 1 and 2 tracing for DBSS exit trace points, the trace header is always followed by:
DBSS EXIT: L_OPCODE='DBSS-opcode-name' RETCODE=---n...n (RETCODE is the DBSS Return Code)
For all level two trace points and for components having only 1 level of tracing, processing and debugging variables are displayed after the above information. Variables are displayed in the general form:
or
The L or G prefix indicates that the variable is only locally addressable to the issuing module (L), or is globally addressable through control blocks to all modules (G).
Varname should be the name of the data item (simple entity, structure or substructure) by which the issuing module addresses the data item.
Value-or-string is of the form:
More lines are included as needed for up to 32 kilobytes of hex data. For lines 2 to n, the first 4 characters are the hex offset of displayed hex dump data (for example, 0 for the first line, 30 for the second line). The rest of the line is hex output displayed in groups of 8 hex characters (each a binary word) with 12 groups per line (less only if end of output data reached).
Trace output may also contain printable character strings that are trace point dependent and clarify processing being performed or the data being displayed.