/*DJC RUNIF
When to run dependent jobs
The RUNIF statement defines dependencies that the job has on other jobs or events in the DJC Group. A dependency can also be on a job or DJC Event in another Group. If the job contains multiple RUNIF statements, they are treated as OR conditions. in other words, the first (possibly only) statement for which the condition (or conditions) is true determines the disposition of the job in the context of the DJC Group.
A single RUNIF can have as many conditions as you wish. The multiple conditions are specified by following the RUNIF with a DJC ANDIF statement.
/*DJC RUNIF //*+DJC RUNIF | name [,GROUP=groupname] [,conditional-clause] |
name
Indicates which job-related conditions or event must be satisfied before DJC can release this job, and can be:
- A jobname, or
- A DJC Event name, which consists of 2-9 alphanumeric or national characters, the first of which must be a per cent sign (%).
Specifies that the dependency is to be satisfied by another DJC Group. If one does not already exist, it is created and the dependency is recorded.
groupname
Is a DJC Group name, which consists of 1-8 alphanumeric characters, the first of which must alphabetic or national, optionally followed by a period and a second level name, also consisting of 1-8 alphanumeric characters.
conditional-clause
This can be one of the following:
CODE ComparisonOperator CompletionCode
GE, GT, EQ, LE, LT, NE
The completion code must have the following format:
nnnn
Refers to a step completion code, or a completion code signaled by a DJC Event. nnnn represents a 1-4 digit decimal number between 0-4095.
The comparison operators allowed are:
EQ, NE
The abend code must have one of the following formats:
Sxxx
Refers to a system abend, such as SB37. xxx represents a three digit hexadecimal number. All the digits must be coded, e. g. S001.
Unnnn
Refers to a user abend code. nnnn represents a four digit number between 0-4095. All the digits must be coded, e.g. U0001.
EVEN
The job or DJC Event ends normally or abnormally, but does not fail on a runtime condition, and is not flushed.
FAILS
The job fails on a runtime condition, such as “unit not available.”<Body indent 2>
FLUSH
The referenced job was flushed from the DJC Group because the Group completed or because of a specific action.
NORMAL
The job or DJC Event ends without a system or user abend code, does not fail on a runtime condition, and is not flushed. This is the default.
ONLY
The job or DJC Event ends with a system or user abend code.
SYSTEM_ABEND
The job or DJC Event ends with a system abend code.
USER_ABEND
The job or DJC Event ends with a user abend code.
Examples:
If job JOB0001 (in the same DJC Group) terminates with a maximum step return code less than or equal 8, this job is run.
If the event %READY is signaled from Group PROGR01.DAILY with a condition code of 4, this job is run.
If JOBXXXX terminates with a system abend of B37, this job is run.
See Also: /*DJC ANDIF .
Notes:
If a job contains RUNIF statements it is not released for execution until at least one of the RUNIF statements is satisfied (i.e. the specified condition yields a result of TRUE).
A job is not held unless it contains at least one RUNIF (or CONDIF) statement or the job is held when it is introduced by some other means.