Watch for Trace Event Exit Program


  Required Parameter Group:

1 Trace option setting Input Char(10)
2 Reserved Input Char(10)
3 Error detected Output Char(10)
4 Comparison data Input Char(*)

  QSYSINC/H member name: ESCWCHT

The Trace commands such as STRCMNTRC, STRTRC, TRCINT and TRCCNN have the capability to watch for a specific event and end the trace when this event occurs. An event can be a message being sent to a specific message queue, history log, job log, LIC log, or a PAL entry. PAL stands for Product Activity Log which shows errors that have occurred (such as in disk and tape units, communications, and work stations). If specified in the TRCPGM parameter, the watch for trace event facility will call a user-written program in the circumstances specified in the Trace option setting parameter.


Authorities and Locks

None.


Required Parameter Group

Trace option setting
INPUT; CHAR(10)

The reason indicating the moment at which the user-written program was called. The possible values are:

*ON The watch for trace facility is starting.
*MSGID A match on a message specified on WCHMSG parameter occurred.
*LICLOG A match on a LIC log specified on the WCHLICLOG parameter occurred.
*CMPDATA The major and minor code of a LIC log matched, but the comparison data did not.
*INTVAL The time interval specified on TRCPGMITV parameter is elapsed.
*WCHTIMO The length of time to watch specified on WCHTIMO is elapsed.
*PAL A match on a PAL and any associated comparison data specified on the WCHPAL parameter occurred.

Error detected
OUTPUT; CHAR(10)

Indicates if the trace event facility should stop or continue running, or if an error on the user-written program was found. The possible values are:

*CONTINUE The trace and the watch for trace event facility will continue running
*STOP The trace and the watch for trace event facility will be ended
*ERROR Error detected by customer trace program.

Comparison data
INPUT; CHAR(*)

The format of the trace information depends on the Trace option setting causing the exit program to be called. The format of the Comparison data is as follows if the Trace option setting is *MSGID:

Offset Type Field
Dec Hex
0 0 BINARY(4) Length of trace information
4 4 CHAR(7) Message watched
11 B CHAR(9) Reserved
20 14 BINARY(4) Offset to comparison data
24 18 BINARY(4) Length of comparison data
28 1C CHAR(*) Message comparison data

The format of the Comparison data is as follows if the Trace option setting is *LICLOG or *CMPDATA:

Offset Type Field
Dec Hex
0 0 BINARY(4) Length of trace information
4 4 CHAR(4) LIC Log major code
8 8 CHAR(4) LIC Log minor code
12 C CHAR(8) LIC Log identifier
20 14 BINARY(4) Offset to comparison data
24 18 BINARY(4) Length of comparison data
28 1C CHAR(*) LIC Log comparison data

The format of the Comparison data is as follows if the Trace option setting is *ON, *INTVAL or *WCHTIMO:

Offset Type Field
Dec Hex
0 0 BINARY(4) Length of trace information (always 4 at this time)

The format of the Comparison data is as follows if the Trace option setting is *PAL:

Offset Type Field
Dec Hex
0 0 BINARY(4) Length of trace information
4 4 CHAR(8) System reference code
12 C CHAR(10) Device name
22 16 CHAR(4) Device type
26 1A CHAR(4) Model
30 1E CHAR(15) Serial number
45 2D CHAR(10) Resource name
55 37 CHAR(8) Log identifier
63 3F CHAR(8) PAL timestamp
71 47 CHAR(4) Reference code
75 4B CHAR(8) Secondary code
83 53 CHAR(8) Table identifier
91 5B CHAR(1) Reserved
92 5C BINARY(4) Sequence
96 60 BINARY(4) Offset to comparison data
100 64 BINARY(4) Length of comparison data
104 68 CHAR(10) PAL compare against
* * CHAR(*) PAL comparison data

Field Descriptions

Device name. The name of a physical device or program that has an entry in the log.

Device type. The number or word used to identify a product.

Length of trace information. The length of the Comparison data parameter passed to the user-written exit program.

Length of comparison data. The length of the user specified text to be compared against the event data.

LIC Log identifier. The LIC Log entry identifier of the LIC Log that occurred.

LIC Log major code. The major code of the LIC Log that occurred.

LIC Log minor code. The minor code of the LIC Log that occurred.

LIC Log comparison data. The user specified text string used to compare against the entry data of the watched for log entry.

Log identifier. The unique identifier that ties together all data related to a single error condition.

Message ID. The identifier of the message that occurred.

Message comparison data. The user specified text string used to compare against the entry data of the watched for message.

Start of changeMessage watched. The message that ocurred. The following special values can be passed:

message id The 7-character message identifier of the message that occurred.
*IMMED An immediate or impromptu message occurred.
End of change

Model. The numbers or letters used to identify the feature level of a product with a given type (for example, Model A or Model 1).

Offset to comparison data. The offset to the field that holds the comparison data.

PAL timestamp. The timestamp of when the PAL entry was added. The format for this field is the system time-stamp format. The Convert Date and Time Format (QWCCVTDT) API can be used to convert a time-stamp value to character format.

Reference code. The code that identifies the unique condition for logging the PAL entry.

Resource name. The name of a physical device that has an entry in the log. A resource name is assigned at first by the system, but may have been changed to a new value by a user.

Secondary code. The code for the failing condition (for example, IOP return code, processor step code, program return code, or major minor code).

Sequence. The numbers assigned to the entries in the log that indicate the sequence in which the entries were added. The highest number is the most recent.

Serial number. The number assigned to a part or machine type at the time of manufacture.

System reference code. The code that identifies a unique logging condition. The system reference code is made up of the first four digits of the translate table ID followed by the four digits of the reference code.

Table ID. The identifier of the table that identifies a group of reference codes.


Related Information

See the following for more information:



Exit program introduced: V5R3

[ Back to top | Communications APIs | APIs by category ]