WATCH_INFO view
The WATCH_INFO view returns information about watch sessions on the system.
The values returned for the columns in the view are closely related to the values returned by the WRKWCH (Work with Watches) CL command and by the Retrieve Watch List (QSCRWCHL) and Retrieve Watch Information (QSCRWCHI) API.
- *USE authority to the QSYS/QSCRWCHL and QSYS/QSCRWCHI programs, and
-
- *SERVICE special authority, or
- Authorization to the QIBM_SERVICE_WATCH and QIBM_SERVICE_TRACE function usage identifiers.
The following table describes the columns in the view. The system name is WATCH_INFO. The schema is QSYS2.
Column Name | System Column Name | Data Type | Description |
---|---|---|---|
SESSION_ID | SESSION_ID | VARCHAR(10) | The session identifier for the watch. |
ORIGIN | ORIGIN | VARCHAR(9) | The name of the command or the API that started the watch.
|
ORIGIN_JOB | ORIGIN_JOB | VARCHAR(28) | The qualified job name that started the watch session. |
START_TIMESTAMP | WCH_START | TIMESTAMP | The timestamp of when the watch was started. |
USER_ID | USER_ID | VARCHAR(10) | The name of the user that started the watch session. |
WATCH_SESSION_TYPE | WCH_TYPE | VARCHAR(7) | Identifies the type of watch according to its origin.
|
STATUS | STATUS | VARCHAR(6) | The status of the watch session.
|
JOB_RUN_PRIORITY | PRIORITY | INTEGER | The priority for the job where the watch session work will be run. |
WATCHED_MESSAGE_COUNT | MSG_COUNT | INTEGER | The number of messages being watched. |
WATCHED_LIC_LOG_COUNT | LIC_COUNT | INTEGER | The number of LIC logs being watched. |
WATCHED_PAL_COUNT | PAL_COUNT | INTEGER | The number of PALs being watched. |
WATCH_PROGRAM_LIBRARY | WCH_PGMLIB | VARCHAR(10) Nullable
|
The name of the library where the watch program is located.
Contains the null value if WATCH_PROGRAM is null. |
WATCH_PROGRAM | WCH_PGM | VARCHAR(10) Nullable
|
The name of the program called to notify that a specified watch
event occurred. Contains the null value if a watch program is not specified or not found. |
WATCH_PROGRAM_CALL_START | CALL_START | VARCHAR(3) Nullable
|
Whether the watch program will be called before starting watching
for any event.
Contains the null value if WATCH_PROGRAM is null. |
WATCH_PROGRAM_CALL_END | CALL_END | VARCHAR(3) Nullable
|
Whether the watch program will be called when the watch session is
ending.
Contains the null value if WATCH_PROGRAM is null. |
TIME_LIMIT | TIME_LIMIT | INTEGER Nullable
|
The time limit, in minutes, for watching for a message, a LIC log
entry, or a PAL entry. A non-null value is only returned for watch sessions started by a trace
command. When the specified amount of time has elapsed, the program identified by the WATCH_PROGRAM column is called, the watch is ended, and message CPI3999 is sent to the history log. Contains the null value if the watch session was started by a trace command and did not specify a time limit or for sessions not started by a trace command. |
TIME_INTERVAL | INTERVAL | INTEGER Nullable
|
The interval of time, in seconds, of how often the trace exit
program is called. Contains the null value if the watch session was started by a trace command and did not specify an interval or for sessions not started by a trace command. |
Example
- List all the service monitor watches that are currently
active.
SELECT * FROM QSYS2.WATCH_INFO WHERE WATCH_SESSION_TYPE = '*SRVMON' AND STATUS = 'ACTIVE';