Creating and managing run cycle groups and their run cycles

Why using run cycle groups
By using run cycle groups, you can benefit from the following advantages:
A run cycle group is a distinct database object
It is defined by itself and can be matched with one or more job streams. It is not defined as part of a specific job stream like single run cycles.
The same run cycle group can be used on different job streams
This improves the overall usability of the run cycles, because you can specify the same run cycle group in multiple job streams, avoiding the need to have multiple run cycle definitions for the same scheduling rules.
Run cycle groups enhance the use of exclusive run cycles
Exclusive (or negative) run cycles are used to generate negative occurrences, which identify the days when a job stream would normally be scheduled but is not required. The sum of the exclusive run cycles are subtracted from the inclusive ones. A negative occurrence always cancels any matching positive occurrences and you can specify a negative occurrence only if the positive equivalent already exists. An exact matching of the days, as well as any time restrictions, is required between the exclusive and inclusive run cycles for the cancellation to occur. Run cycle groups add much flexibility by allowing users to apply exclusive run cycles to a subset of the positive ones rather than to all of them. Group your run cycles into subsets so that the exclusive run cycles can be applied only to the positive occurrences generated by the run cycles belonging to the same set.

Run cycles must be organized into subsets within a run cycle group. The subsets are always in a logical OR relationship with each other. The result of the run cycle group is always a date or set of dates; it cannot be negative.

For example, you might want your job stream to run every day of the month except the last day of the month. But, you also want the it to be scheduled on the last day of the year (the last day of December). You can define a run cycle group using subsets, as follows:
Subset 1
  • Run cycle 1 - Inclusive run cycle every day of the month
  • Run cycle 2 - Exclusive run cycle on the last day of the month
Subset 2
  • Run cycle 3 - Inclusive run cycle on December 31st
where, run cycle 2 cancels the last day of each month in Subset 1, while run cycle 3 generates December 31st as a separate date and therefore you can schedule the job stream on Dec 31st.
Run cycle groups allow the use of a logical AND between individual run cycles in the subset
By default, the run cycles within a subset are in a logical OR relationship but you can change this to a logical AND, if the run cycle group result is a positive date or set of dates (Inclusive). For each run cycle, you can specify either operator (AND ,OR), obtaining the following behavior:  
  1. All the run cycles of the group that are in AND relationship are calculated first. The result of this calculation is a date or a set of dates.
  2. Then, all the run cycles in an OR relationship are added to the result of the previous step.

A similar behavior is applied to inclusive and exclusive run cycles to determine the final date or set of dates of a group.

Inclusive (A)
Rule-based run cycle. Select days when the job stream is to be run if they belong to all A types of the set of run cycles.
Exclusive (D)
Exclusion rule-based run cycle. Select days when the job stream is NOT to be run if they belong to all D types of the set of run cycles.
For example, you can add two conditions together:
Run on Wednesday “AND” the 8th workday of the month. 
In this way, the only scheduled dates are any 8th work day of the month that falls on a Wednesday.
Full compatibility with traditional run cycles
The traditional run cycles specified in the job stream definition can reference run cycle groups, with the possibility to specify shift or offsets on them (as with periods for z/OS or calendars for distributed systems).
A set of dates (interval starts) is created automatically either at run cycle level directly (inclusively or exclusively with offsets, or in the rule. This is a two-step process with run cycles:
  1. Define the key "business event", such as, Month End, using run cycles and free day rules
  2. Define rules that use the dates of the "business event" as the intervals against which the other batch run can be scheduled relative to.
For example, you have a Month End process that runs on the Last Friday of a month, but that moves forward to the next working day, except in December when it runs on the 3rd Friday of the month. This scheduling rule can be defined with a few rules, run cycles, and free day rules.

Two working days before Month End you need to run a pre-validation process to allow problems to be addressed before the run. You cannot choose the last Wednesday of the month, because in some months this might occur after the last Friday. Similarly, if the last Friday was a free day, the last Wednesday will not be 2 working days before it, because the Free Day rule applies ONLY to the day the rule falls on, it cannot look at anything else.

Many other batch runs might also need to be run on a certain number of days before or after the Month End, but the same restrictions apply.

You can now define work to run relative to something defined by a combination of run cycles and free day rules.

Use of calendars with run cycles within a run cycle group

Optionally, you can specify more than one calendar to calculate the working and non-working days definition for a run cycle. The primary calendar is used to calculate which working days are valid, and a secondary calendar is used to calculate specific non-working dates. If the dates calculated according to the secondary calendar match with the working days in the primary calendar, the job is scheduled; if they do not match, the job is not scheduled.

For example, a global company that runs workload in the United States for many other countries needs many calendar combinations to ensure that the batch jobs only run on a day that is a working day both in the United States and the other country. The calendar can be defined at job stream level and, if not specified, a default calendar is used. However, the calendar at run cycle level, whenever defined, can be used as secondary calendar and the job stream (or default) calendar can be used as the primary calendar.

For example, Primary calendar can be WORKDAYS, which is defined as MONDAY to FRIDAY excluding US holiday dates. You might also need to calculate the job runs based on calendar HKWORK, which is defined as Monday to Friday excluding Hong Kong holiday dates. The job might have several schedules:
  • Run on working days, but not the last working day and not Mondays
  • Run on Mondays, but not on the last working day
  • Run on the last working day
Because each schedule is calculated against the WORKHK calendar it is also checked against the WORKDAYS calendar to ensure that it is scheduled on a US working day.
The use of time restrictions with run cycle groups
You can specify time constraints to define the time when processing must start or the time after which processing must no longer start. To do this, you can associate time restrictions to job, job streams, run cycles, and run cycle groups. When you define a time restriction, you basically obtain a time. Because you can associate time restrictions to multiple objects, the following hierarchy shows the order by which the different time restrictions are taken into consideration to actually define when to start the processing:
  1. Time restriction defined in the run cycle into the job stream
  2. Time restriction defined in the job stream
  3. Time restriction defined in the run cycle contained in the run cycle group associated to the job stream.
  4. Time restriction defined in the run cycle group associated to the job stream.
  5. Start of Day
This means that:
Time restrictions in the job stream
Override and take precedence over any other time restrictions defined in the run cycles or run cycle groups associated to the job stream.
No time restrictions in the job stream nor in the run cycle group
The group generates only a date that is the Start Of Day. If offsets and free day rules are to be calculated, the calculation always starts from the Start Of Day.
Time restrictions in the run cycle group (not in the job stream)
Time restrictions (and possible offset) are calculated starting from the Start Of Day and the resulting date and time indicate the start of processing.

Examples

Table 1. Scenario 1. No time restriction in the run cycle group
Run cycle group Scheduled date Earliest Start
Run cycle group 10/24 10/24
Run cycle group with offset (+ 3 days) 10/27 (Saturday) 10/27/ (Saturday)
Run cycle group with free day rule 10/29/ (Monday) 0/29/ (Monday)
     
Run cycle in the job stream with time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with free day rule 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with earliest start +1 1pm 11/02 (Friday) 11/03 (Saturday) 1pm
     
Run cycle in the job stream without time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/02 (Friday) Start of Day
Run cycle in the job stream with free day rule 11/02 (Friday) 11/02 (Friday) Start of Day
Table 2. Scenario 2. Time restriction in the run cycle group without offset
Run cycle group Scheduled date Earliest Start
Run cycle group 10/24 10/24
Run cycle group with calendar offset (+ 3 days) 10/27/ (Saturday) 10/27/ (Saturday)
Run cycle group with free day rule 10/29/ (Monday) 0/29/ (Monday)
     
Run cycle in the job stream with time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with free day rule 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with earliest start +1 1pm 11/02 (Friday) 11/03 (Saturday) 1pm
     
Run cycle in the job stream without time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/02 (Friday) Start of Day
Run cycle in the job stream with free day rule 11/02 (Friday) 11/02 (Friday) Start of Day
Table 3. Scenario 3. Time restriction in the run cycle group with offset (+1 12:00)
Run cycle group Scheduled date Earliest Start
Run cycle group 10/24 10/24
Run cycle group with calendar offset (+ 3 days) 10/27/ (Saturday) 10/27/ (Saturday)
Run cycle group with free day rule 10/29/ (Monday) 10/29/ (Monday)
Run cycle group with offset +1 12:00 10/29/ (Monday) 10/30 12:00 (Tuesday)
     
Run cycle in the job stream with time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with free day rule 11/02 (Friday) 11/02 (Friday)
Run cycle in the job stream with earliest start +1 1pm 11/02 (Friday) 11/03 (Saturday) 1pm
     
Run cycle in the job stream without time restrictions    
Run cycle in the job stream with + 4 working days shift 11/02 (Friday) 11/03 12:00 (Saturday)
Run cycle in the job stream with free day rule 11/02 (Friday) 11/03 12:00 (Saturday)
Availability of the GENDAYS command at run cycle group level
Using GENDAYS, you can check the result of the combination of all the run cycles in the group.

When you create a run cycle within a run cycle group, you must include it in a subset, identified by a subset ID.

Managing subsets of run cycles provides a lot of flexibility in job stream scheduling.

For example, you create run cycle group that contains three run cycles, two inclusive and one exclusive, in OR relationship:
RC1
Inclusive: run every Thursday of the month.
RC2
Inclusive: run every Friday of the month.
RC3
Exclusive: do not run the first week of each month.
In this case the result would be: the job stream runs every Thursday and Friday of the month except for those occurring in the first week of the month.
But if you want that the job stream also runs the first Thursday of the month, you could accomplish your goal by organizing your run cycles in subsets:
RC1
Inclusive: run every Thursday of the month.
RCSubset
RC2
Inclusive: run every Friday of the month.
RC3
Exclusive: do not run the first week of each month.
In this way the result would be: the job stream runs every Thursday of the month and every Friday of the month, except for the first Friday.
From the Workload Designer, you can run the following actions on run cycle groups:
  • Create
  • Create like
  • Delete
  • Edit
  • View
To open the Workload Designer, do the following:
  1. Log in to the Dashboard Application Services Hub.
  2. From the navigation toolbar, click Administration >Workload Design>Manage Workload Definitions

    In the displayed window, you are required to select an engine to connect with.

  3. Enter the name of an engine and click Go.

    The Workload Designer opens.

To create a run cycle group:
  1. Click New in the Working List pane of the Workload designer window.
  2. Select Run Cycle group in the resulting list of objects.

    A Properties - Run Cycle group pane is opened on the bottom-right section of the window.

  3. Enter the properties of the new run cycle group as requested. You can proceed to define the run cycles that are part of the group or leave this task for later.
  4. To save your data, click the box next to the run cycle group name listed in the Working list pane and select the Save selected icon in the menu bar.

    To exit the Properties - Run Cycle group pane without saving your data, click the box next to the run cycle group name listed in the Working list pane and select the Delete selected icon in the menu bar.

You can also create a run cycle group starting from an existing one. To do so, list the existing run cycle group and click the Create Like icon.

To run any of the other actions on already defined run cycle groups, you must first list the run cycle groups upon which you want to act. You can do this in one of the following ways:
  • Click Search in the Working List pane:
    1. Select Run Cycle group in the resulting list of objects.

      The Search - Run Cycle group window is displayed.

    2. Click Search to display a list of all the run cycle groups defined on the engine. Before doing so, you can narrow your search by entering names or partial names in the text box.

      The found run cycle group definitions are listed.

    3. Select the run cycle groups you want to act upon and click Edit, View, or Delete.

      If you clicked Edit or View, the selected groups, inclusive of their run cycles, are listed in the Working List pane, with the properties of the top one displayed on the right pane.

      If you clicked Delete, you are asked to confirm the deletion from a pop-up window.

  • Click the Run Cycle group icon in the Quick Open pane:
    1. Click Search to display a list of all the run cycle groups defined on the engine. Before doing so, you can narrow your search by entering names or partial names in the text box.

      The found run cycle group definitions are listed in the Quick Open pane.

    2. Select the run cycle groups you want to act upon and click Edit or View. You cannot delete from this pane.

      The selected groups, inclusive of their run cycles, are listed in the Working List pane, with the properties of the top one displayed on the right pane.

To add run cycles to the group you are creating you must first include them in a subset, to do it perform the following steps:
  1. From the Details view, right-click the run cycle group in the Details view and select Add Subset.
  2. Right-click the subset and select Add Run Cycle .
  3. Specify the run cycle attributes in the Run Cycle properties pane displayed at the bottom.
You can toggle between the panels displaying the properties of the run cycle group and of the included run cycles by selecting the entries listed in the Type column

To view, edit, or create another run cycle of a run cycle group, just click the corresponding icon in the Working List pane or in the Details pane.

When you create a group of run cycles, you can choose whether the run cycles must be in AND or in OR relationship. However, the result of the run cycles combined within the group must be a set of dates; the group cannot produce an exclusive result.