CEMT SET TASK

Change the status of one or more tasks to terminate a task or change its priority.

In the CICS Explorer, the Tasks operations view provides a functional equivalent to this command.

Description

You can terminate a task and specify whether to maintain system and data integrity, system integrity only, or neither, before the task is terminated. You can set the priority of a task.

You cannot specify a list of identifiers, nor can you use the asterisk (*) and plus (+) symbols to specify a family of tasks.

When purging or forcepurging a task, if CICS detects that the task has a Db2 thread currently active in Db2, CICS issues a Db2 cancel thread request before proceeding with the purge of the CICS task. This ensures that the purge does not cause problems for Db2 and that the Db2 updates are safely backed out. If the task has a Db2 thread but it is not currently active in Db2, then a cancel thread is not required. The Db2 thread is used as normal to back out the Db2 updates when CICS backs out the unit of work as a result of the purge of the task. This capability requires APAR PI92893 on DB2® Version 11 or higher.

Syntax

Press the Clear key to clear the screen. You can start this transaction in two ways:
  • Type CEMT SET TASK (or suitable abbreviations for the keywords), followed by (value) or ALL. The resulting display lists the current status, similar to the status obtained by using the CEMT INQUIRE TASK command. You can then move to the highlighted or blank fields and type over them with the required values.
  • Type CEMT SET TASK (or suitable abbreviations for the keywords), followed by (value) or ALL, then followed by one or more attribute settings that you want to change. For example, cemt s ta(value) pu makes the specified task purgeable in system-stall conditions.

Typing ? at the beginning of either the first or second line gives a syntax prompt. Resetting the values takes effect immediately.

CEMT SET TASK

Read syntax diagramSkip visual syntax diagram CEMT SET TASK ( value)ALLPRIORITY( value)PURGEFORCEPURGEKILL

Options

(value)
The task number, generated by CICS. This is in the range 1 - 99999.
ALL
Any changes you request are made to all resources of the specified type that you are authorized to access.
FORCEPURGE
Terminate the task as soon as it is consistent with system integrity, and without regard to data integrity. CICS® cannot always determine whether a forced purge is safe; it is possible to abend the system when you specify this option. For example, if a task is forcepurged during backout processing, CICS terminates abnormally. If you want to terminate a task, but do not want to terminate CICS, use the PURGE option instead.
KILL
Terminate the task. System and data integrity is not guaranteed. The KILL option extends the PURGE and FORCEPURGE options. Use this option only after first attempting a purge or forced purge. The KILL option does not guarantee integrity of any kind, but in some situations you can use it to free up a stalled region, thus enabling the region to continue processing. In some cases, for example, if a task is killed during backout processing, CICS terminates abnormally.
PRIORITY (value)
Specifies the priority of the task in the range 0 - 255, where 255 is the highest priority.
PURGE
Terminate the task as soon as both system and data integrity can be maintained.

If the task is associated with an open TCB, you might experience a delay of about a minute before the task is finally purged.

Note: You cannot issue SET PURGE if the definition of the TRANSACTION it is executing specifies SPURGE=NO. SET TASK PURGE cannot be used to terminate a task running in a JVM server. To terminate tasks active in a JVM server, use the SET JVMSERVER PURGE command.