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.
- The jobname specified in the JOBNAME= parameter of the START command
or
The identifier specified on the START command.
- The jobname specified on the JOB JCL statement within the member.
- 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.
- The device number associated with the IEFRDER DD statement within the member.
- The member name.
- The jobname specified in the JOBNAME= parameter of the START command
- 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:- 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.
- 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.
- 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:
c example,dump
Example 2:
c example
Example 3:
c example,a=7F
Example 4:
c u=*logon*,a=3d
Example 5:
c u=a237
Example 6:
c u=a237,dump
Example 7:
c 232
Example 8:
c 3330
Example 9:
c 00e
Example 10:
c 00e
Example 11:
c /3480
Example 12:
C mail,a=2c
Example 13:
c /f00e
Example 14:
c aor2.*
Example 15:
c aor2.t1*
Example 16:
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
CANCEL CHAD3
CANCEL U=CHAD