End Watch (QSCEWCH) API
Required Parameter Group:
Default Public Authority: *EXCLUDE
The End Watch (QSCEWCH) API ends a watch session that was started by a STRWCH (Start Watch) command or by the Start Watch (QSCSWCH) API. Watch sessions started by trace commands (STRTRC, TRCINT, TRCCNN, STRCMNTRC, TRCTCPAPP) will be ended but the associated trace will remain active.
Note: A watch session can be ended from the same job that issued the start function or from a different job.
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 function 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, can also be used to
change the list of users that are allowed to start and end watch
- Authority to watch session
- If ending a watch session that is watching for a message within a job log, the issuer
of the API must be running under a user profile which is the same as the job user identity of
the job being watched, or the issuer of the API must be running under a user profile which
has job control (*JOBCTL) special authority. Job control (*JOBCTL) special authority is also
required when ending a session where jobs with a generic user name are being watched.
If you end a watch session that was started with *ALL for the watch job name or with a generic user name, you must have *ALLOBJ special authority or must be authorized to the Watch Any Job function of the IBM i through System i Navigator's Application Administration support. The Change Function Usage (CHGFCNUSG) command, with a function ID of QIBM_WATCH_ANY_JOB, can also be used to change the list of users that are allowed to start and end watch operations.
Required Parameter Group
- Session ID
- INPUT; CHAR(10)
The session identifier for the watch to be ended. This name must match the session identifier of a watch that had been previously started and is still active. You can use these special values for this parameter:
*PRV The watch session most recently started by the same user who is running this API will be ended. For example, if the job running the API is running under user profile BOB, the last watch session started under user profile BOB is ended. *ALL All active watch sessions are to be ended. generic-name The generic watch session(s) to be ended. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all sessions with identifiers that begin with the generic prefix that are to be ended.
- Error code
- I/O; CHAR(*)
The structure in which to return error information. For the format of the structure, see Error code parameter.
The following messages may be sent from this function:
|Message ID||Error Message Text|
|CPF24B4||Severe error while addressing parameter list.|
|CPF3C20||Error found by program &1.|
|CPF3CF1||Error code parameter not valid.|
|CPF39E1||Watch session ID &1 not found.|
|CPF39E2||There is no active watch session for current user profile.|
|CPF39E6||The user does not have the required authority.|
|CPF39E8||Not enough authority to watch operations.|
|CPF39E9||*JOBCTL special authority required.|
|CPF39EE||&1 watch sessions ended. &2 not ended.|
|CPF39EF||No watch sessions matching the &1 criteria.|
|CPF9872||Program or service program &1 in library &2 ended. Reason code &3.|
|CPF9899||Error occurred during processing of command.|
API introduced: V5R4