Creating run cycles with rules

About this task

Follow these steps to create run cycles using rules:
  1. In the CREATING AN APPLICATION panel (EQQACGPP - Creating an application ), enter the RUN command. You see the RUN CYCLES panel, shown in EQQAMRPL - Run cycles .
    Figure 1. EQQAMRPL - Run cycles
    EQQAMRPL ------------------------ RUN CYCLES ----------------  ROW 1 TO 1 OF 1
    Command ===>                                                  Scroll ===> PAGE
    
    Enter/Change data in the rows, and/or enter any of the following
    row commands:
    I(nn) - Insert, R(nn),RR(nn) - Repeat, D(nn),DD - Delete
    S - Specify run days/Modify rule
    
    Application            : PAYTAXYR         YEARLY PAYROLL RUN
         Name of rg/                            In       Out of
    Row  period/rule Input Deadline       F day effect   Effect   Variable table
    cmd              HH.MM day HH.MM Type rule  YY/MM/DD YY/MM/DD
    '''' TAXYEAR_    12.00 00  23.59 R    1     97/01/30 71/12/31 PAY_____________
         Text: Run on the third Thursday in July_________________
         Shift: ___0  Shift Type: _
    
    ******************************* BOTTOM OF DATA *******************************
  2. Specify the name of the rule, for example TAXYEAR. The name should be unique within the application or group, and it is less confusing if you do not use the name of a period; choose a naming convention, perhaps with the rule type as the first character.

    If you intend to use a run cycle group to specify the run days in this rule, do not enter here the name of the run cycle group, but enter a name that uniquely identifies the run cycle.

  3. Specify the input arrival time in HH.MM format for the days specified by the rule. This time determines when occurrences of the application will be included in the current plan, with regard to the current planning period. This time is also used by the scheduler when external dependencies are established. For additional information, see Specifying the input arrival time.

    This information is optional unless you plan to specify the EVERY options for the run cycle.

    Note: For details on the effect of specifying an input arrival time earlier than the workday end time, see How days are generated using rules.
  4. Specify the deadline day and time, which is the latest time that all operations in any occurrence of the application should be completed by. The deadline day is relative to the input arrival date for the occurrence. Specify a number from 0 to 99, where 0 means that the deadline date is also the input arrival date. When the deadline day is greater than 0, HCL Workload Automation for Z considers only work days when calculating the deadline date. For example, if day is 1, the deadline date is the first work day (as specified by the calendar) after the input arrival date.

    The deadline day and time that you specify is also the default for all operations in the application.

    This value is optional. If no value is specified, when the long term plan is created, the deadline of the occurrence is made to coincide approximately with the end of the LTP (which is derived from the tail end value of the current plan).

  5. Specify the type of run cycle, which can be:
    R
    Regular rule.
    E
    Exclusion rule. Specify one or more of these ONLY after you specify an R or N type run cycle.
    N
    Normal run cycle using periods and offsets. See Creating run cycles with offsets for more information about offset-based run cycles.
    X
    Exclusion run cycle using periods and offsets. Specify one or more of these ONLY after you specify an R or N type run cycle.
    Note: Enter R if you plan to specify the run days with a run cycle group.
  6. Specify the free-day rule. See Selecting a free-day rule for a full description.

    If you are going to specify the run days with a run cycle group, specify rule 3 (count work and free days) to ensure that the dates generated by the run cycle group are matched correctly also in case a different calendar is used.

  7. Specify the in-effect and out-of-effect dates. If you leave these blank, HCL Workload Automation for Z fills them in with today's date and 71/12/31, 31 December 2071. For hints on using these dates, see Using in-effect/out-of-effect dates.
  8. Specify the variable table that are to be used on the days selected by this run cycle. For information about job tailoring, see Job tailoring.
    Note: When you use rule-based run cycles with periods that you have created, HCL Workload Automation for Z ignores any variable table associated with the period, so you must specify any table name here, unless:
    • The occurrence operations do not use variable substitution.
    • You specify the table name on the LONG TERM PLAN panel.
    • You specify the table name on the MODIFY CURRENT PLAN (MCP) panel when you add the occurrence manually to the plan.
    • You specify the table name in the job itself.
    • The operations use the global variable table.
  9. Type a description of the rule in the line below the other fields.
  10. Optionally, enter the number of days to shift the rule dates. This field provides the means to define a run cycle relative to another, where the run cycle without the shifting offset is used to schedule an application in relation to which - using the same rule with a negative or positive shift of days - another application is scheduled.
  11. If you entered a value for Shift, specify the type of days that are to be counted for the shift. W implies work days, while D implies any day in the calendar.
    Note: When the long term plan is generated, the shift value is applied first and the free-day rule is applied next.
  12. Enter the S row command to specify the days that this rule will select (type R) or deselect (type E). You see the MODIFYING A RULE panel, shown in EQQRULEP - Modifying a rule .
    Figure 2. EQQRULEP - Modifying a rule
    EQQRULEP --------------------- MODIFYING A RULE -------------------------------
    Command ===>
    
    Enter the GENDAYS command to display the dates generated by this rule
    Enter the E command to specify EVERY options
    Enter S and user data in the fields below to define a rule
    
    Application   : PAYTAXYR                  YEARLY PAYROLL RUN
    Rule          : TAXYEAR    Run on the third Thursday in July
    
     --- Frequency ---         --- Day ---    --- Cycle Specification ---
    -------------------------------------------------------------------------------
            S Only          │  _ Day       │  _ Week       _ January    S July
            _ Every         │  _ Free day  │  _ Month      _ February   _ August
                            │  _ Work day  │  _ Year       _ March      _ September
     _ First     _ Last     │  _ Monday    │               _ April      _ October
     _ Second    _ 2nd Last │  _ Tuesday   │               _ May        _ November
     S Third     _ 3rd Last │  _ Wednesday │               _ June       _ December
     _ Fourth    _ 4th Last │  S Thursday  │  Week number  __ __ __ __ __ __
     _ Fifth     _ 5th Last │  _ Friday    │  Period/RG    ________ ________
       ___ ___     ___ ___  │  _ Saturday  │  name         ________ ________
       ___ ___     ___ ___  │  _ Sunday    │
       ___ ___     ___ ___  │              │  Shift default origin by  ___ days
    -------------------------------------------------------------------------------
  13. In the Frequency column, select Only or Every.
  14. Also in the Frequency column, select an ordinal number from First to Fifth and 6 to 999 or its Last equivalent. Type numbers higher than 5th in the blanks below Fifth or 5th Last, and use numerics here not ordinals (for example, 6 instead of 6th). You can select more than one number.
  15. In the Day column, select the type of day. You can select more than one type.
  16. In the Cycle Specification column, select the type of cycle, period, or run cycle group. You can make multiple selections. You can enter up to four periods and run cycle groups. You can shift the origin of any cycles or periods that you specify by 1 to 999 days, if you are using EVERY. The default origin of each week is Monday. Week 1 is specified as the first week with at least 4 days of the new year.

    You can also specify a shifted origin together with EVERY LAST: the origin is shifted from the end, so that EVERY 2nd LAST DAY in JANUARY with shifted origin 1 means January 30, 28, 26, and so on. You cannot specify a shifted origin with ONLY, and do not need to, because ONLY FIRST with shifted origin 1 is equivalent to ONLY SECOND.

    EVERY SECOND DAY in YEAR, with no origin shift specified, means January 1, 3, 5, and so on: the series always starts on the first day of the cycle or period unless you shift the origin.

    Note: If you select July, for example, the rule does not look for a period called JULY; the cycle is predefined and not alterable. If you really need to use your own JULY period, type the name JULY in the Period name field.
  17. Enter the GENDAYS command to check that the rule causes the days’ selection that you expect. This is especially important for selections with Every, Last, and multiple selections in the Day and Cycle columns. You see the LIST OF GENERATED DATES panel:
    Figure 3. EQQRULSL - List of generated dates
    EQQRULSL ------------------ LIST OF GENERATED DATES ---------------------------
    Command ===>                                                  Scroll ===> PAGE
                                                               Goto Year ===>
    Rule        : THIRDTHU   Third Thursday of the Month
    Calendar    : DEFAULT            Work day end time: 00.00
    Interval    : 97/01/30 - 99/12/29    Free day rule: 1
    
          January         1997  February        1997  March           1997
          Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su
                01 02 03 04 05                 01 02                 01 02
          06 07 08 09 10 11 12  03 04 05 06 07 08 09  03 04 05 06 07 08 09
          13 14 15 16 17 18 19  10 11 12 13 14 15 16  10 11 12 13 14 15 16
          20 21 22 23 24 25 26  17 18 19 2021 22 23  17 18 19 20 21 22 23
          27 28 29 30 31        24 25 26 27 28        24 25 26 27 28 29 30
                                                      31
          April           1997  May             1997  June            1997
          Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su
             01 02 03 04 05 06           01 02 03 04                    01
          07 08 09 10 11 12 13  05 06 07 08 09 10 11  02 03 04 05 06 07 08
    
          14 15 16 1718 19 20  12 13 14 1516 17 18  09 10 11 12 13 14 15
          21 22 23 24 25 26 27  19 20 21 22 23 24 25  16 17 18 1920 21 22
          28 29 30              26 27 28 29 30 31     23 24 25 26 27 28 29
                                                      30
    Attention:
    1. If you have not specified a calendar for the application or for the run cycle group, GENDAYS uses the calendar specified under the OPTIONS panel (0.2 from the main menu), or the calendar named DEFAULT if no calendar is specified. If the DEFAULT calendar does not exist, all days are considered work days. For long-term plan batch jobs, however, HCL Workload Automation for Z uses the calendar specified on the CALENDAR keyword of the BATCHOPT initialization statement, or the DEFAULT calendar. Make sure that you specify the same calendar in the panel and BATCHOPT (if you do not specify the calendar for the application in the CREATING AN APPLICATION - EQQACGPP panel) or you might find that GENDAYS shows you different days to those generated when you extend the long-term plan.
    2. The interval displayed by the GENDAYS command is defined as the shortest time period that these dates overlap:
      • Application validity range
      • Run cycle validity range
      • Four years forward from 1 January current year
  18. Enter PF3 (End) to return to the RUN CYCLES panel.
  19. Repeat steps 2 to 18 for regular (R) and exception (E) rules, until you have completely specified when the application should be scheduled.