cancel job

You can use the cancel job command to cancel a job.

Overview

If you cancel a job before it is launched, the job is not launched. When you attempt to cancel a job after it is launched, it continues to run.

To run the cancel command, you must have cancel access to the job.

Note: If you cancel a job in status successful and internal status SUCC, the job status becomes canceled and the internal status remains SUCC.

Syntax and command line options

Before you run the command, you must give the details of the command line options. The pend and noask command line parameters are optional. This allows you to complete a command by using only the jobselect paramter. You can create the command as follows:

ocli plan cancel job | cj jobselect [;pend] [;noask]

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

jobselect

Specify the job to update, by using attributes and qualifiers.

For example, enter the following command WA_AGT_0#JOB_STREAM.JOB.

pend
You can use the pend option to remove dependencies that are associated with the job 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 related to the pend option are listed in the following table.
Action Job status Result
pend added Not started The job is not canceled until all associated dependencies are resolved. After the job is canceled, the jobs and job streams that are related to the cancelled job are removed from the dependencies.
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 jobs or job streams that are related to the canceled job are removed from the dependencies.
Notes:
  1. You can use the rerun command to rerun canceled jobs, or jobs that are marked as [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 as [Cancel Pend], either enter a release command for the job or enter another cancel command without the pend option.
  3. For jobs with an 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 canceled until you release or delete the until time, or enter another cancel command without the pend option.
  4. If you cancel pending a job in status successful and internal status SUCC, the job status becomes canceled and the internal status remains SUCC.

noask

When you add the noask option as an argument, the agent does not ask for confirmation before it acts on each qualifying item.

Examples

  1. To cancel a job report in the dsrtfe(0801 04/11/04) job stream on stat4 workstation, run the following command:
    ocli plan cj=stat4#dsrtfe(0801 04/11/04).report
  2. To cancel a job setup in the sri4(1000 05/12/08) job stream, if it is not in the ABEND state, run the following command:
    ocli plan cj sri4(1000 05/12/08).setup~state=abend
  3. To cancel the job6 job in the sched4(0700 04/11/06) job stream only after its dependencies are resolved, run the following command:
    ocli plan cj sched4(0700 04/11/06).job3;pend