End Watch (ENDWCH)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The End Watch (ENDWCH) command ends a watch session that was started by a STRWCH (Start Watch) command or by Start Watch (QSCSWCH) API.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
SSNID Session ID Name, *PRV Required, Positional 1
Top

Session ID (SSNID)

Specifies a session identifier for the watch to be ended. This name must match the session identifier of a watch session that had been previously started and is still active.

This is a required parameter.

*PRV
The watch session most recently started by the same user who is running this ENDWCH command will be ended. For example, if the job running the ENDWCH command is running under user profile BOB, the last watch session started under user profile BOB is ended.
name
Specify the session identifier of the watch to be ended.
Top

Examples

Example 1: End Most Recently Started Watch

ENDWCH   SSNID(*PRV)

This command ends the watch session started most recently by the same user who is running the ENDWCH command.

Example 2: End a Specific Watch Session

ENDWCH   SSNID(MYSESSION)

This command ends the watch session MYSESSION.

Top

Error messages

*ESCAPE Messages

CPF39EC
Cannot end watch session &1 started by &2 command.
CPF39E1
Watch session &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.
Top