Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
DTAMBR | Data member | Name | Optional, Positional 1 |
DTALIB | Data library | Name, *CURLIB | Optional |
SLTJOB | Select jobs | Single values: *ALL Other values (up to 10 repetitions): Qualified job name |
Optional |
Qualifier 1: Select jobs | Generic name, name | ||
Qualifier 2: User | Generic name, name, *ALL | ||
Qualifier 3: Number | 000001-999999, *ALL | ||
DLTTRC | Delete trace | *YES, *NO | Optional |
SORT | Sort by | *TIME, *THREAD | Optional |
OUTPUT | Output | *PRINT, *OUTFILE | Optional |
OUTFILE | File to receive output | Qualified object name | Optional |
Qualifier 1: File to receive output | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
OUTMBR | Output member options | Element list | Optional |
Element 1: Member to receive output | Name, *FIRST | ||
Element 2: Replace or add records | *ADD, *REPLACE |
Top |
Specifies the member name for the trace data that you want to print. The member name will be the same as the trace session identifier specified on the Start Trace (STRTRC) and End Trace (ENDTRC) commands. The member name is the same for each of the physical files that contain the trace data.
This is a required parameter.
Top |
Specifies the library that contains the set of database files where the collected trace data is stored.
Top |
Specifies which jobs to include in the trace listing. This allows the user to reduce the size of the trace listing by selecting only a subset of the jobs that were part of the trace. Up to ten qualified job names can be specified.
Single values
Qualifier 1: Select jobs
Qualifier 2: User
Qualifier 3: Number
Top |
Specifies whether trace data is deleted after is has been printed.
Top |
Specifies how the trace data for each job is sorted in the specified output file.
Top |
Specifies whether the output from the command is printed with the job's spooled output or sent to a database file.
Top |
Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.
Qualifier 1: File to receive output
Qualifier 2: Library
Note: If this command creates the file, the text is "OUTFILE created by PRTTRC command" and the public authority is *EXCLUDE.
Top |
Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.
Element 1: Member to receive output
If the member exists, you can add records to the end of the existing member or clear the existing member and add the records.
Element 2: Replace or add records
Top |
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.
Top |
*ESCAPE Messages
Top |