Retrieve Watch List (QSCRWCHL) API


  Required Parameter Group:


  Default Public Authority: *EXCLUDE

  Threadsafe: No

The Retrieve Watch List (QSCRWCHL) API generates a list of all or some watch sessions on the system.

The QSCRWCHL API produces a list similar to the list produced by the Work with Watches (WRKWCH) command.


Authorities and Locks

Authority to use the API
To use this API, you must have service (*SERVICE) special authority or must be authorized to the Service watch and Service trace functions of the IBM i through System i™ Navigator's Application Administration support. The Change Function Usage (CHGFCNUSG) command, with a function ID of QIBM_SERVICE_WATCH and QIBM_SERVICE_TRACE, can also be used to change the list of users that are allowed to perform watch operations.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the list of watch sessions.

Length of receiver variable
INPUT; BINARY(4)

The size of the receiver variable. If the length is larger than the size of the receiver variable, the results may not be predictable. The minimum length is 8 bytes.

Receiver format name
INPUT; CHAR(8)

The format of the watch list to be returned.You can use these special values for this parameter:

For more information, see Format of the Generated List.

Watch selection information
INPUT; CHAR(*)

The information that identifies the watch information to be returned. The format of this information depends on the specified Watch selection format.

Watch selection information format
INPUT; CHAR(8)

Indicates which watch sessions will be retrieved. The possible values are:

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter. If this parameter is omitted, diagnostic and escape messages are issued to the application.


Format of the Generated List

For detailed descriptions of the fields in the list returned, see Field Descriptions.


WCHL0100 Format

The following information is returned in the receiver variable for the WCHL0100 format.



Watch selection information format

For detailed descriptions of the fields in the list returned, see Field Descriptions.


WCHF0100 Format



Field Descriptions

Bytes available. The length of all data available to return. All available data is returned if enough space is provided.

Bytes returned. The length of the data actually returned. The number of bytes returned is always less than or equal to both the number of bytes available and the receiving variable length.

Number of watch sessions. The number of watch sessions returned on the API call.

Offset to watch sessions list. The offset from the beginning of the structure to the start of the watch sessions list.

Origin. The name of the command or the API that started the watch. Valid values are:

Reserved. A reserved field. This field is set to hexadecimal or binary zero.

Session ID. The session identifier for the watch. Valid values are:

Size of watch session entry. The size in bytes of a watch session entry (session id, origin, user id, and status). The watch session list consists of one or more watch session entries.

Status. The status of the watch session. Valid values are:

User ID. The user identifier of user that started the watch session. Valid values are:

Watch session type. Identifies the type of watch according to its origin. Valid values are:



Error Messages




API introduced: IBM® i 7.1

[ Back to top | Problem Management APIs | APIs by category ]