## zowe › ca7 › commands › cancel › 1

The CANCEL command deletes jobs from the CA Workload Automation CA 7® Edition queues.

For CPU jobs, the CANCEL command only removes the job from the queues.
Cancelation of a job in the active queue or ready queue (if it has been submitted)
does not cause termination of the job's execution.
CPU jobs that can be executing have to be canceled from the operating system separately.
Execution must be terminated from an OS system console.
For XPJOB jobs, the CANCEL command removes the job from the queues.
If the XPDEF initialization option XPKILL is set to YES,
and the XPJOB job has been submitted to the target node but is still in the ready queue or the active queue,
a cancel request is created and sent to the target node.
Some remote CA Scheduling Agents support the cancel request, and the request cancels or 'kills' the process execution.
It is not the responsibility of CA WA CA 7 Edition to verify that the target platform supports the kill facility.
If the cancel request was not transmitted, an error message appears in the browse and log data.
For agent definition jobs (AGJOBs), the CANCEL command sends a request to the agent and removes the job from the queues.
If the agent is not active at the time of the CANCEL request, the message is queued and sent when the agent becomes active.
If the XPDEF initialization option XPKILL is set to NO, the XPJOB is canceled from the queues, and no cancel request is sent to the target platform.
To view the XPKILL option, enter the command /DISPLAY,ST=XPS.

This function is available on the QM.1, QM.6, and QM.7 panels as option C.
The CANCEL command has three formats, depending on the queues in which the task resides.

#### Usage

zowe ca7 commands cancel_1 [options]

#### Options

- `--key` (string)

  - The command transaction key

- `--ca7#` (string)

  - Indicates the individual job to cancel, and the value must be a CA 7 job number.

- `--force` (string)

  - (Optional) Specifies to force the cancellation of the job.
    If you want to cancel the job to dump the log data set, specify FORCE=YES to prevent the job from being resubmitted.
    Use FORCE=YES when a job to be canceled shows a status of SKELETON or RETRY.
    Use FORCE=YES to cancel a job with connected resources.
    Warning! Use of this option can potentially cause CA WA CA 7 Edition to abend; therefore, only use it as a last resort.

- `--reason` (string)

  - (Optional) Defines the reason for the job cancellation.
    Depending on the initialization file CANCEL statement value, this reason can be required or optional.
    If it is required but not given, a message prompts the user to provide it.
    The text is entered into the run log entry for this occurrence of this job and is displayed on any subsequent LRLOG inquiries.
    Limits:
    1 to 40 alphanumeric characters
    Required:
    No (depending on initialization options)

#### CA7 Connection Options

- `--host` | `-H` (string)

  - Host name of the CA7 API service that is running on the mainframe system.

- `--port` | `-P` (number)

  - Port for the CA7 API service that is running on the mainframe system.

- `--user` | `-u` (string)

  - User name for authenticating connections to the CA7 API service that is running on the mainframe system.

- `--password` | `--pass` | `--pw` (string)

  - Password for authenticating connections to the CA7 API service that is running on the mainframe system.

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

- `--protocol` | `-o` (string)

  - Specifies protocol to use for CA7 connection (http or https).

    Allowed values: http, https

#### Profile Options

- `--ca7-profile` | `--ca7-p` (string)

  - The name of a (ca7) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication.

    Note: The CLI does not support certificate files that require a password. For more information, search Troubleshooting PEM Certificates in Zowe Docs.

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Examples

- Cancels a job request for ca7 number 0016 from CA 7:

  - `zowe ca7 commands cancel_1 --ca7# 0016`