CL Command Reference - ENDWCH

CL Command List > ENDWCH Reference

Description:

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:

. To use this command, 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.

. If ending a watch session that is watching for a message within a job log, the issuer of the command 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 command 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.


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.