| Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The End Trace (ENDTRC) command ends a trace session that was started by a STRTRC (Start Trace) command.
Restrictions:
| Top |
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| SSNID | Session ID | Name, *PRV | Required, Positional 1 |
| OPTION | Option | *END, *EXTRACT | Optional |
| DTAOPT | Data option | *LIB, *DLT | Optional |
| DTALIB | Data library | Name, *CURLIB | Optional |
| RPLDTA | Replace data | *YES, *NO | Optional |
| SLTJOB | Select jobs | Single values: *ALL Other values (up to 8 repetitions): Element list |
Optional |
| Element 1: Job name | Qualified job name | ||
| Qualifier 1: Job name | Name | ||
| Qualifier 2: User | Name | ||
| Qualifier 3: Number | 000001-999999 | ||
| Element 2: Thread ID to include |
Single values: *ALL Other values (up to 20 repetitions): Character value, *INITIAL |
||
| PRTTRC | Print trace data | *NO, *YES | Optional |
| Top |
Specifies a session identifier for the trace to be ended. This name must match the session identifier of a trace that had been previously started and is still active.
This is a required parameter.
| Top |
Specifies if trace data will be preserved in the internal buffers where it was collected after the session is ended.
| Top |
Specifies if the trace data that has been collected is stored into database files.
Note: This option is only valid if *END was specified for the Option (OPTION) parameter.
| Top |
Specifies the name of the library in which the trace data will be stored. A set of database files will be created in this library to contain the trace data. The files will be created if they do not already exist.
Note: This parameter is valid only if *LIB is specified for the Data option (DTAOPT) parameter.
| Top |
Specifies whether trace data that was collected by a previous trace session with the same session identifier is replaced with new trace data. This is determined by checking if the set of database files where the trace data is to be stored already have file members with the same name as the specified trace session identifier (SSNID parameter).
Note: This parameter is valid only if *LIB is specified for the Data option (DTAOPT) parameter.
| Top |
Specifies which jobs to include in the data collection. This allows the user to reduce the size of the trace data by selecting only a subset of the jobs that were part of the collection. Up to 8 qualified job names can be specified.
Note: This parameter is valid only if *LIB is specified for the Data option (DTAOPT) parameter.
Single values
Other values (up to 8 repetitions)
Element 1: Job name
Qualifier 1: Job name
Qualifier 2: User
Qualifier 3: Number
Element 2: Thread ID to include
Single values
Other values (up to 20 repetitions)
| Top |
Specifies whether trace data is formatted and printed after it is stored in the trace database files.
Note: This parameter is valid only if *LIB is specified for the Data option (DTAOPT) parameter.
| Top |
Example 1: End Most Recently Started Trace
ENDTRC SSNID(*PRV)
This command ends the trace session started most recently by the same user who is running the ENDTRC command. The trace data will be stored in a set of files in the current library of the job, or QGPL if there is no current library for the job.
Example 2: End a Trace and Delete Trace Data
ENDTRC SSNID(DCG1)
OPTION(*END)
DTAOPT(*DLT)
This command ends the trace session DCG1 and deletes the trace data.
Example 3: End a Trace Session Extracting a Specific Job to be Collected
ENDTRC SSNID(MYTRACE)
OPTION(*EXTRACT)
SLTJOB((123456/MYUSER/MYJOBNAME))
This command ends the trace session MYTRACE; only the 123456/MYUSER/MYJOBNAME job is collected. The session might be extracted again later.
| Top |
*ESCAPE Messages
| Top |