Parameters

jobname
The name of the batch job, started task, or APPC/MVS transaction program to be canceled.
The job name for a given started task can be assigned based on a variety of inputs. These inputs are examined in the following order, so that if item #1 is not specified, item #2 is used. If neither #1 nor #2 is specified, then #3 is used, and so on.
  1. The jobname specified in the JOBNAME= parameter of the START command

    or

    The identifier specified on the START command.

  2. The jobname specified on the JOB JCL statement within the member.
  3. The device number specified on the START command, or the device number associated with the device type specified on the START command

    or

    The device number associated with the device type specified on the START command.

  4. The device number associated with the IEFRDER DD statement within the member.
  5. The member name.
U=userid
The user ID of the time-sharing user you want to cancel.
If the user is just logging on and does not yet have a unique name, you must find out the address space identifier for the user (see the explanation under A=asid) and use the following version of the command:
  • CANCEL U=*LOGON*,A=asid
[jobname.]identifier
The identifier for the unit of work that you want to cancel, optionally preceded by the job name.
The following types of identifiers can be used:
  • The identifier that was specified on the START command.
  • [/]devnum, the device number specified when the START or MOUNT command was entered. The device number is 3 or 4 hexadecimal digits, optionally preceded by a slash (/). You can precede the device number with a slash to prevent ambiguity between the device number and a device type or identifier.
  • devicetype, the type of device specified when the START or MOUNT command was issued.
If no identifier was specified on the START command, the system assigns temporary identifier “STARTING” to the unit of work, until the system can assign an identifier according to the following order of precedence:
  1. If an identifier was not specified on the START command, the identifier is the device type (for example, 3410) or device number (for example, X‘0000’) specified on the START or MOUNT command.
  2. If an identifier, a device type, or a device number was not specified on the START or MOUNT command, the identifier is the device type specified on an IEFRDER DD statement (invoking a cataloged procedure) in the JCL.
  3. If none of the these was specified, the identifier defaults to the job name.
When you specify jobname.identifier, then identifier can be represented by any of the following:
  • An asterisk
  • One or more characters from the beginning of the identifier, followed by an asterisk
  • The entire identifier

When you specify an asterisk, the system responds with message IEE422I.

Attention: When you use the asterisk format, the command affects all started tasks that begin with the specified characters. Device numbers are assumed to be four-digit numbers; for example, /13* would match on 1301, 1302, and so on, but would not match on 13C, because 13C is interpreted as 013C.

Specifying both the job name and the entire identifier causes the command to take effect if one and only one work unit with that combination of job name and identifier is running. For the case where more than one work units with the same combination of job name and identifier are running, see the description of the A=asid parameter.

DUMP
A dump is to be taken. The type of dump (SYSABEND, SYSUDUMP, or SYSMDUMP) depends on the JCL for the job. A dump request is only valid when made while the job is running. Dumps are not taken during job allocation or deallocation.

Note: You can use DUMP with any of the other CANCEL parameters.

A=asid
The hexadecimal address space identifier of the work unit you want to cancel.

If more than one work unit is running with the same job name, identifier, combination of job name and identifier, or user ID that you specified on the CANCEL command, the system rejects the command because it does not know which work unit to cancel. To avoid this, you must add the parameter A=asid to your original CANCEL command in order to specify the address space identifier of the work unit.

Note: If the asterisk format is used, you will not be prompted for A=asid. Rather, all work units meeting the specified criteria will be canceled.

You can use the CANCEL operator command to cancel z/OS UNIX address spaces. Each address space is equivalent to a z/OS UNIX process.

To find out the address space identifier for a unit of work, you can use the DISPLAY command as follows:

DISPLAY JOBS,ALL
Lists the address space identifiers for all batch jobs and started tasks.
DISPLAY ASCH,ALL
Lists the address space identifiers for all APPC/MVS transaction programs.
DISPLAY TS,ALL
Lists the address space identifiers for all logged-on time-sharing users.
DISPLAY OMVS,ASID=ALL or DISPLAY OMVS,A=ALL
Lists the address space identifiers for all z/OS UNIX processes.
Note: A=asid can be used with any of the other CANCEL parameters except if you specify jobname.identifier with an asterisk (for example, CANCEL aor2.tl*).
ARMRESTART
Indicates that the batch job or started task should be automatically restarted after the cancel completes, if it is registered as an element of the automatic restart manager. If the job or task is not registered or if you do not specify this parameter, MVS™ will not automatically restart the job or task.

Example 1:

Cancel the job named EXAMPLE and take a dump.
c example,dump

Example 2:

Cancel the job named EXAMPLE. Whether you get a dump or not depends on the system routine in control when you enter the command.
c example

Example 3:

Of all jobs named EXAMPLE in the system, cancel only the one whose address space identifier is 7F.
c example,a=7F

Example 4:

Log off the system the user just logging on who has an address space identifier of 3D but does not yet have a unique user identifier.
c u=*logon*,a=3d

Example 5:

Log user A237 off the system.
c u=a237

Example 6:

Log user A237 off the system and take a dump.
c u=a237,dump

Example 7:

Cancel the MOUNT command that requests a volume to be mounted on device number 232, enter:
c 232

Example 8:

Cancel the MOUNT command that requests a volume to be mounted on a 3330 device type.
c 3330

Example 9:

End the device allocation for a writer with device number 00E.
c 00e

Example 10:

End the output processing being done for device number 00E and cause another output data set to be processed.
c 00e

Example 11:

End the output processing being done for device number 3480 and cause another output data set to be processed.
c /3480

Example 12:

Of all the transaction programs running with the job name MAIL, end only the one whose address space identifier is 2C, which is the APPC/MVS scheduler (ASCH) initiator ASID.
C mail,a=2c

Example 13:

End the device allocation for a writer on device number F00E.
c /f00e

Example 14:

There are several tasks running with jobname AOR2. End all of those tasks.
c aor2.*

Example 15:

There are several tasks running with jobname AOR2. Some of those tasks have identifiers beginning T1. End only those specific tasks.
c aor2.t1*

Example 16:

The following example shows an operator session that cancels a process that is running the shell command sleep 6000 for the TSO/E user CHAD.
DISPLAY OMVS,U=CHAD

BPXO001I 17.12.23 DISPLAY OMVS 700                                      C
OMVS     ACTIVE                                               BPXPRMHF
USER    JOBNAME  ASID        PID       PPID  STATE   START     CT_SECS
CHAD    CHAD     001D     262147          1  RI    17.00.10      1.203
CHAD    CHAD     001B     131076          5  SI    17.00.10       .111
  LATCHWAITPID=         0 CMD=sleep 6000
CHAD    CHAD     0041          5     262147   IW   17.00.10       .596
  LATCHWAITPID=         0 CMD=-sh
CHAD    CHAD3    001B     131076          5  SI    17.00.10       .111
  LATCHWAITPID=         0 CMD=sleep 6000
If you want to cancel only the process that is running the shell command sleep 6000, enter:
CANCEL CHAD3
If you want to cancel the TSO/E user CHAD altogether, enter:
CANCEL U=CHAD