CL Command Reference - PRTTRC
CL Command List > PRTTRC Reference
Description:
The Print Trace (PRTTRC) command formats and writes the trace records to the selected output file. The trace records were written to a set of database files by the ENDTRC (End Trace) command and PRTTRC is used to format these trace records to a spooled output file or to a database output file. If the trace records are written to a spooled output file, printer file QPSRVTRCJ is used. The user data for the spooled file will be the same as the value specified for the DTAMBR (Data member) parameter.
Restrictions:
. To use this command, you must have service (*SERVICE) special authority, or be authorized to the Service trace function of Operating System through iSeries Navigator¡¯s Application Administration support. The Change Function Usage (CHGFCNUSG) command, with a function ID of QIBM_SERVICE_TRACE, can also be used to change the list of users that are allowed to perform trace operations.
. You must have authority to the library and the database files within that library where the trace data is stored.
v If DLTTRC(*YES) is specified, you must have authority to the DLTTRC (Delete Trace Data) command.
. The record format of the database output file must match the record format of the IBM-supplied output file QASCTJFL.
v The ENDTRC command that produced the trace data and the PRTTRC command that processes and formats the trace data must be run on the same release of Operating System.
Examples:
Example 1: Print and Delete Trace
PRTTRC DTAMBR(TRACE8) DTALIB(TRCLIB1) DLTTRC(*YES)
This command formats and prints the trace data contained in database file members named TRACE8 in library TRCLIB1. The trace data members are removed after the trace data spooled file has been written. All jobs which were part of the trace will be part of the trace listing.
Example 2: Print Subset Trace
PRTTRC DTAMBR(T123456789) DTALIB(QGPL)
SLTJOB(*ALL/QSYS/QCMN*) DLTTRC(*YES)
This command formats and prints the trace data contained in database file members named T123456789 in library QGPL. The trace data members are removed after the trace data spooled file has been written. Only those traced jobs that were started under user profile QSYS and had job names that started with ¡åQCMN¡å will be part of the trace listing.
Example 3: Print Trace and Sort by Time
PRTTRC DTAMBR(MYTRACE) DTALIB(MYTRCLIB)
DLTTRC(*YES) SORT(*TIME)
This command formats and prints the trace data contained in database file members named MYTRACE in library MYTRCLIB. The trace data members are removed after the trace data spooled file has been written. The trace records are sorted by the time the record was collected. If the traced jobs were multithreaded, the trace output is sorted by job, with all threads in that job sorted by time. The resulting output may have trace information for multiple threads intermingled.
Example 4: Print Trace to an Output File
PRTTRC DTAMBR(BIGTRACE) DTALIB(TRACELIB) DLTTRC(*YES)
OUTPUT(*OUTFILE) OUTFILE(MYLIB/MYFILE)
This command stores the trace data contained in database file members named BIGTRACE in library TRACELIB into a database output file named MYFILE in library MYLIB. The trace data members named BIGTRACE are removed after the trace data has been written to the database output file.