Skybot Software Announces the Acquisition of Open Systems Management      Learn more

Precondition/Dependency handling

(Click on images for higher definition view)

In commercial data processing, it is common for batch jobs to be dependent on the completion of other jobs or system events before they can run. In fact, a reliable dependency mechanism is necessary for complex batch job schedules to be broken down into collections of simpler tasks. Once this has been done, the collections of inter-dependent tasks must be capable of being easily managed as a group.

suite jobs

A suite may be thought of as a named container for any number of related, inter-dependent jobs. The order in which the jobs in a suite are processed is defined by the pre-conditions set up between the jobs.

In order to provide additional flexibility in responding to external events, a job may be dependent on a job within another suite or an actual external event. Preconditions can be of two types:

  • event preconditions test conditions external to cosbatch, for example, the existence of a file, the presence of a process in execution, or the availability of disk space.  cosbatch also provides a facility for a user organization to define their own custom events as preconditions;
  • suite job termination preconditions test the completion, exit statuses and textual outputs from cosbatch suites and suite jobs. 

Event preconditions can be attached to standalone jobs, suites and suite jobs.  Suite job termination preconditions can be attached to suites and to suite jobs.  If an object has both a suite job termination precondition and an event precondition, then the former must be satisfied before the latter is tested.

By using these mechanisms, complex, multi-task job scheduling with all the necessary error-handling may be easily performed using cosbatch.

In order to provide complete flexibility in defining preconditions, cosbatch is equipped with a simple but powerful language that allows the user to define the precondition that must be satisfied before a job may run.

The functions in the language take account of either the numeric exit status of a previous job, or the contents of a character string (message) written by a previous job. The statements in the language may then be used to test the value of the status, or the contents of the string, and combine them logically to decide whether the job should run or not.  Examples of the statements used include:

=          (equal to)
~          (contains)
&   |     (AND, OR)
!           (NOT)
< >       (less than, greater than)
[   ]       (inclusive AND)
{  }       (inclusive OR)

Of course, the GUI provided with cosbatch allows the user to define and change these preconditions using drag and drop capabilities, without having to learn the syntax of the precondition language described above.