Start of changeEnd Watch (QSCEWCH) API


  Required Parameter Group:

1 Session ID Input Char(10)
2 Error Code I/O Char(*)

  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.

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 be authorized to the Service watch function of Operating System through iSeries 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 ending a watch session that was started specifying *ALL for the watch job name, or a generic user name, you must have *ALLOBJ special authority, or be authorized to the Watch any job function of Operating System through iSeries 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 this special value 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.

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:

Message ID Error Message Text
CPF24B4 Severe error while addressing parameter list.
CPF3CF1 Error code parameter not valid.
CPF39EC Cannot end watch session &1 started by &2 command.
CPF39E1 Watch session ID &1 not found.
CPF39E2 There is not any 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.
CPF9872 Program or service program &1 in library &2 ended. Reason code &3.

End of change
API introduced: V5R4
Top | Problem Management APIs | APIs by category