cancel job

You can use the cancel command to cancel a job.

Overview

As the name suggests the cancel command is used to cancel a job. If you cancel a job before it is launched, the job is not launched. When you cancel a job after it is launched, it continues to run. If you cancel a job that is running and it completes in the ABEND state, no automatic job recovery steps are attempted to relaunch the job.
Restriction: When the command is submitted, the agent will not ask for your confirmation before taking action on each jobs.
To run the cancel command, you must have the cancel access to the job. For more information about security access roles, see Security role definition.

Syntax and command line options

Before you run the command, you can specify the different options to customize the result. The command line parameters pend and noask are optional. This allows you to complete a command using the single parameter jobselect. You can create the command as described below.

cancel job | cj = <jobselect><pend><noask>

You can add the option pend to resolve the dependencies associated with the job, before the job is cancelled. The details that are required with each parameters are as follows:

jobselect

Specify the job to update, by means of attributes and qualifiers.

For example, WA_AGT_0#JOB_STREAM.JOB.

pend

You can use the pend option to remove the dependencies that are associated with the job that you want to cancel. If you do not use the pend option, jobs and job streams that are dependent on the cancelled job are released immediately from the dependency. The different scenarios that are related to the pend option are as follows:
Action Job status Result
pend added Not started The job is not cancelled until all the associated dependencies are resolved. After the job is cancelled, the jobs and job streams that are related to the cancelled job are removed from the dependency.
Note: While the cancel action is postponed, the notation Cancel Pend is listed in the Dependencies column of the job in a showjobs display.
pend added started The option is ignored and any job or job streams that are related to the cancelled job are removed from the dependency.
Notes:
  1. You can use the rerun command to rerun jobs that are cancelled, or that are marked Cancel Pend. You can also add and delete dependencies on jobs that are marked Cancel Pend.
  2. You can immediately cancel a job that is marked Cancel Pend, either enter a release command for the job or enter another cancel command without the pend option.
  3. For the jobs with expired until parameter, the notation Until is listed in the Dependencies column in a showjobs display, and their dependencies are no longer evaluated. If such a job is also marked Cancel Pend, it is not cancelled until you release or delete the until time, or enter another cancel command without the pend option. To stop evaluating the options added along with the job, set the priority of a job to zero with the altpri command. To resume dependency evaluation, set the priority to a value greater than zero.

noask

When you add the option as an argument the agent will not ask for confirmation before taking action on each qualifying job.

Note:

In the case of internetwork dependencies, cancelling a job in the EXTERNAL job stream releases all local jobs and job streams from the dependency. Jobs in the EXTERNAL job stream represent jobs and job streams that have been specified as internetwork dependencies. The status of an internetwork dependency is not checked after a cancel is performed. For more information, see Managing internetwork dependencies in the plan.

Examples

  1. To cancel job report in job stream apwkly(0900 02/19/06) on workstation site3, run the following command:
    cj=site3#apwkly(0900 02/19/06).report
  2. To cancel job setup in job stream mis5(1100 02/10/06), if it is not in the ABEND state, run the following command:
    cj mis5(1100 02/10/06).setup~state=abend
  3. To cancel job job3 in job stream sked3(0900 02/19/03) only after its dependencies are resolved, run the following command:
    cj sked3(0900 02/19/06).job3;pend