CL Command Reference - TRCJOB
CL Command List > TRCJOB Reference
Description:
The Trace Job (TRCJOB) command controls traces of original program model (OPM) programs and Integrated Language Environment (ILE) procedure calls and returns that occur in the current job or in the job being serviced as a result of the Start Service Job (STRSRVJOB) command directed to that job. The command, which sets a trace on or off, can trace module flow, operating system data acquisition (including CL command traces), or both.
If the Start Service Job (STRSRVJOB) command is entered before the TRCJOB command, the job that is traced is the one identified by the STRSRVJOB command.
The TRCJOB command issues under the covers the STRTRC command when SET(*ON) is specified or the ENDTRC command when SET(*OFF) or SET(*END) is specified.
Restrictions:
1. The record format of the database output file must match the record format of the IBM-supplied output file QATRCJOB.
2. The number of trace records processed between the start and end of the trace must not exceed one million.
3. The Transfer Job (TFRJOB) command must not be issued while TRCJOB command is active.
4. The following user profiles have private authorities to use the command:
. QPGMR
. QSRV
. QSRVBAS
. QSYSOPR
. QRJE
Examples:
Example 1: Tracing Flow of Control
TRCJOB TRCTYPE(*FLOW) MAXSTG(40)
This command traces the flow of the current job. Trace records are collected for each OPM program and ILE procedure call and return that occurs in the job. The trace file contains 40K of storage and wraps (oldest records are replaced by new records) if that amount of storage is filled with trace records.
Example 2: Stopping the Trace Operation
TRCJOB SET(*OFF) OUTPUT(*OUTFILE) OUTFILE(QGPL/TRCJOB)
OUTMBR(TRCDTA)
This command stops the trace and directs the output to the database file QGPL/TRCJOB. The output is directed to the member TRCDTA.
Example 3: Tracing One Thread
TRCJOB SET(*ON) SLTTHD(00000001)
This command traces only the specified thread of the current job.