cancel sched

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

Overview

If you cancel a job stream before it starts, the job stream does not run. When you cancel a job stream after it starts, the jobs in the job stream that are started will complete. The remaining jobs from the job stream are cancelled.

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.
Restriction: When the command is submitted, the agent will not ask for your confirmation before taking action on each jobs.

Syntax and command line options

Before you run the command, you can specify the different options to customize the result. The pend and noask parameters are optional. This allows you to complete a command using only the jstreamselect parameter. You can create the command as follows:

cancel sched | cs = <jstreamselect><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:

jstreamselect

Specify the job stream to update, by means of attributes and qualifiers. For more information, see to Selecting job streams in commands.

pend

You can use the pend option to remove the dependencies that are associated with the job stream which 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 described below.
Action Job stream status Result
pend added Not launched The job stream is not cancelled until all the associated dependencies are resolved. After the job stream is cancelled, the jobs and job streams that are related to the cancelled job stream 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 showschedules display.
pend added Launched The jobs that are not started is cancelled and any job or job streams that are related are removed from the dependency.
Notes:
  1. You can immediately cancel a job stream that is marked Cancel Pend, either enter a release command for the job stream or enter another cancel command without the pend option.
  2. If you want to stop evaluating the dependencies that are added along with the job stream, set the priority of the job stream to zero with the altpri command. To resume dependency evaluation, set the priority to a value greater than zero.
  3. If the cancelled job stream contains jobs defined with the every option, only the last instance of such jobs is listed as canceled in a showjobs display.

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, refer to Managing internetwork dependencies in the plan.

Examples

  1. To cancel job stream sked1(1200 02/17/06) on workstation site2, run the following command:
    cs=site2#sked1(1200 02/17)
  2. To cancel job stream mis2(0900 02/19/06) if it is in the STUCK state, run the following command:
    cs mis2(0900 02/19)+state=stuck