ADRUN - Run cycle segment

The run cycle part of an application description. A run cycle is based either on offsets or on rules. The segment contains the fixed part plus either run cycle offsets or a rule definition.

Type
Required input.
For run cycles based on offsets, type is:
N
Normal run cycle that identifies times and days when the application runs.
X
Negative run cycle that identifies times and days when the application does not run. If you specify a particular day and time as a negative run cycle, no occurrences of the application are generated for that day and time, regardless of what is generated by a normal or regular run cycle. Run cycles are used in conjunction; negative run cycles are used to suppress run days generated by normal or regular run cycles.

For run cycles based on rules, type is:

R
Regular run cycle that identifies times and days when the application runs.
E
Exclusion run cycle that identifies times and days when the application does not run. If you specify a particular day and time as an exclusion run cycle, no occurrences of the application are generated for that day and time, regardless of what is generated by a regular or normal run cycle. Run cycles are used in conjunction; exclusion run cycles are used to suppress run days generated by regular or normal run cycles.
Free day rule
Required input for all run cycles, which indicates how run days are treated:
E
Free days excluded; only work days are taken into account
1
Free days included; run on the nearest day before the free day
2
Free days included; run on the nearest day after the free day
3
Free days included; run on the free day
4
Free days included; do not run at all.
Note: ADRIADALL is the start of either run cycle offsets or a rule. EQQPIFAD sample shows how to handle it.
Table 1. ADRUN Control Block
Offsets        
Dec Hex Type Len Name Description
0 (0) STRUCTURE 228 ADRUN RUNCYCLE SECTION
0 (0) CHARACTER 8 ADRPER PERIOD NAME
8 (8) CHARACTER 6 ADRVALF RUN CYCLE VALID-FROM
14 (E) CHARACTER 6 ADRVALT RUN CYCLE VALID-TO
20 (14) CHARACTER 50 ADRUNDESC RUN CYCLE DESCRIPTION
70 (46) CHARACTER 1 ADRUNRULE RULE FOR WORK/FREE DAYS
71 (47) CHARACTER 1 ADRTYPE

PERIOD BASED (N|X) |
RULE BASED (R|E)

72 (48) SIGNED 4 ADRIAD(24) OFFSETS (START DAYS WITHIN PERIOD)
168 (A8) CHARACTER 4 ADRIAT INPUT ARRIVAL TIME
172 (AC) SIGNED 4 ADRDD DEADLINE DAY RELATIVE TO START
176 (B0) CHARACTER 4 ADRDT DEADLINE TIME
180 (B4) UNSIGNED 1 ADRUNVERS RECORD VERSION NUMBER=1
181 (B5) CHARACTER 16 ADRJVTAB JCL VARIABLE TABLE
197 (C5) CHARACTER 1 ADRSHTYPE SHIFT TYPE (W/D or blank)
198 (C6) SIGNED 2 ADRINPOS

NUMBER OF POSITIVE
RUN CYCLE OFFSETS

200 (C8) SIGNED 2 ADRINNEG NUMBER OF NEGATIVE RUN CYCLE OFFSETS
202 (CA) SIGNED 2 ADRIRDLEN RULE DEFINITION LENGTH
204 (CC) CHARACTER 4 ADRREPEATEVRY REPEAT EVERY
208 (D0) CHARACTER 4 ADRREPEATENDT REPEAT END TIME
212 (D4) SIGNED 4 ADRSHIFT SHIFT VALUE (-999 to 999)
216 (D8) CHARACTER 12 * RESERVED
228 (E4) CHARACTER * ADRIADALL

START OF RUN CYCLE OFFSETS
OR A RULE

Table 2. Run Cycle Offsets
Offsets        
Dec Hex Type Len Name Description
228 (E4) STRUCTURE * ADRIADALL START OF RUN CYCLE OFFSETS
228 (E4) SIGNED 4 ADRIAOFF ARRAY OF RUN CYCLE OFFSETS (LENGTH=(ADRINPOS+ADRINNEG)*4)

Run cycle offsets are an array of positive fullwords. ADRINPOS and ADRINNEG identify the number of entries in the array. The positive offsets are first.

If the total number of offsets is 24 or less, the offsets are also found in the ADRIAD array. ADRIAD is an array of 24 integer values that specify the start days within the period. Each nonzero value defines a day that the run cycle selects; that is, when the application runs if ADRTYPE is N, or does not run if ADRTYPE is X. The first day of the period is specified by 1 and the last day by -1. The first zero value ends the array.

Table 3. Rule Definition
Offsets        
Dec Hex Type Len Name Description
228 (E4) STRUCTURE * ADRIADALL RULE DEFINITION
228 (E4) SIGNED 4 ADRULEL RULE LENGTH (ADRULEL + ADRULET)
232 (E8) CHARACTER * ADRULET RULE TEXT

For a rule-based run cycle, ADRIRDLEN identifies the length of the rule definition. The ADRIADALL structure contains a fullword copy of ADRIRDLEN (ADRULEL), which is followed by the rule text. ADRULEL must specify the same length as ADRIRDLEN. You can insert comments or extra blanks when creating a rule, but these characters are not saved in the AD database.

Here is an example of a rule definition, which selects the third day in each month:
ADRULEL 33 (X'21')
ADRULET 'ADRULE ONLY(3) DAY(DAY) MONTH'
Note: Note that the ADOP segment is enlarged by 32 characters. This will not affect current program interface applications until in a future release, when the reserved field becomes used for operation data.