KILLTASK Statement

For asynchronous tasks, forces one or more active tasks or server sessions to terminate immediately.
Valid in: client session


KILLTASK _ALL_ |task1...taskn ;

Syntax Description

terminates all active asynchronous tasks.
terminates a specific task by a name that corresponds to the server-ID that is associated with the CONNECTREMOTE= option in the RSUBMIT statement.
Restriction:Use the KILLTASK statement only when executing an asynchronous RSUBMIT.


The KILLTASK statement enables users to terminate one or more tasks or server sessions that are executing  asynchronously. The KILLTASK statement is useful only for an asynchronous RSUBMIT.
Note: KILLTASK should be used for asynchronous tasks that seem to be hung or to be having a problem. KILLTASK ends the server session. However, do not substitute KILLTASK for SIGNOFF. Use SIGNOFF to terminate server sessions that are functioning normally.
KILLTASK causes any log or output lines, as applicable, that have accumulated in the backing store to be sent to the parent Log and Output windows. Before the data is sent to the parent Log and Output windows, this message is displayed:
NOTE: Process TASK1 was terminated by KILLTASK statement.
KILLTASK removes the specified task from the list of active tasks and from the LISTTASK output. If KILLTASK is executed for a completed task, this message is displayed and the task will not be terminated:
NOTE: Transaction TASK2 was not killed because it is not running asynchronously.
Task termination also deletes the content of the WORK library of the server session.


After you use the KILLTASK statement to kill a server session that runs under z/OS, you must also sign off the server session. If you do not also sign off the server session, your user ID will still be connected to the server session. Here are the methods for signing off a server session:
  • From the same SAS session from which you issued the KILLTASK statement, sign on to the server session, using your user ID. Then, sign off. The most recently accessed server session is assumed, by default.
    signon user-ID;
    signoff user-ID;
  • Log on to your user ID, and then cancel the user ID using the CANCEL option.
  • Request that an operator cancel your TSO session.
Consult your z/OS documentation for details about logging on and logging off the z/OS operating environment.