End Watch (QSCEWCH) API


  Required Parameter Group:


  Default Public Authority: *EXCLUDE

  Threadsafe: Yes

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 operations.

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:

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Error Messages

The following messages may be sent from this function:




API introduced: V5R4

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