Scripting interface

Top  Previous  Next

In order to take advantage of the features offered by XBM, JCL (scripts) must use the XBM JCL interface, which is a set of commands and tags provided to access the XBM resources.

Static tags

Static tags are provided to statically define and set some resource and property for a JCL. These settings can be detected by XBM at submission time, whe XBM analyzes the script.

All XBM static tags are included in remarks and prefixed by the string "#@xbm" on UNIX/Linux, and by the string <!--@xbm. I.e:

UNIX/Linux:

#@xbm start_paused

Windows:

<!--@xbm start_paused -->

use_resource

The use_resource tag statically defines a resource. When this resource is defined XBM understands the XBM will use it during execution.

Usage

#@xbm use_resource <resource_identifier>

run_on_engine

This tag request XBM to run the JCL on the specified engine.

Usage

#@xbm run_on_engine <engine_id|engine_alias>

run_with_priority

This tag request XBM to run the JCL with specified priority

Usage

#@xbm run_with_priority <priority>

allow_multiple

If this tag is specified more copy of the JCL can run concurrently.

Usage

#@xbm allow_multiple

start_paused

If this tag is specified JCL is set in pause mode (hold) when submitted

Usage

#@xbm start_paused

mail_to

This tag asks to mail the specified address, when JCL completes.

Usage

#@xbm mail_to <email_address>

wait event

This tag asks requires XBM to wait for the specified event variable before to start the job. One or more condition may be specified on the tag according to this syntax:

<value> <operator> <value>

 

where operator is one of the following:

eq

string equal

ne

string not equal

lt 

string less than

le

string less equal

ge

string greater equal

gt

string greater than

=

numeric equal

!=

numeric not equal

<

numeric less than

<=

numeric less equal

>=

numeric greater equal

>

numeric greater

Usage

#@xbm wait event event_name [ condition [ (and|or) condition ] ]

Example

#!/bin/csh
#
#@xbm wait event VAR1
#@xbm wait event VAR2 value = 0 or value = 10
#@xbm wait event VAR3 value eq "OK" or value ne "KO"
#

wait job

This tag asks requires XBM to submit the job depending on the execution of another job (parent). XBM will check if the parent has already been submitted and executed within the time range specified and, if it is not yet started, XBM will wait for the parent execution, before to activate the job. The execution of the job may be also conditioned by the return code of the parent job.

The time range may be one of the following:

submit

time range starts from the job submition time

today

time range starts from the 0:00 AM of the current day

reset 

time range starts from the last issue of xbmc reset command

hh:mm

time range specified hour

Conditions are defined as follows:

[rc|max|mix] <operator> <value>

where operator is one of the following:

=

numeric equal

!=

numeric not equal

<

numeric less than

<=

numeric less equal

>=

numeric greater equal

>

numeric greater

Usage

#@xbm wait job job_name since time_range [ condition [ (and|or) condition ] ]

Example

#!/bin/csh
#
#@xbm wait job JOB01.csh since reset
#@xbm wait job JOB02.csh since today rc = 0
#@xbm wait job JOB03.csh since 15:30 max <= 12 and min >=4
#

wait file

This tag asks requires XBM to wait for the presence of the specified file before to start the job. The status of the file may be tested with these modifiers:

notempty

file length must be greater than zero

read

file must be readable

write

file must be writable

Usage

#@xbm wait file path_name [ modifier [ modifier ] ] 

Example

#!/bin/csh
#
#@xbm wait file /var/tmp/upload.txt
#@xbm wait file /etc/passwd notempty readable
#