Run cycle keywords

In this topic you can find the list of run cycle keywords.

This topic lists all the keywords that you can use when defining a run cycle. You can find the syntax of the scheduling keywords and related examples.

In this topic you can find the following run cycle keywords:

every

You can use the every keyword to define how often a job stream must run.

This keyword must be specified during the definition of the run cycle for the job stream, and it creates instances of the job stream that depends on the repetition rate, on the start time , and on the time defined for everyendtime.

You can use the following syntax:

Syntax

every rate {everyendtime time[+n day[s]]}

Arguments

rate
Using this keyword, you can define how often the instances of the job stream are launched. It is expressed in hours and minutes (hhmm).
everyendtime
time
Using this keyword, you specify the time after which job stream instances cannot run anymore. It is expressed in hours and minutes (hhmm).
n
Using this keyword, you can extend the value of everyendtime, specifying a number of days.
Example
  • In the following example, an instance of the JOBSTREAM1 job stream runs every three hours starting from November 25 to 00.00 a.m. of November 27.
    SCHEDULE WS_AGT_1#JOBSTREAM1 
    ON RUNCYCLE RC0 VALIDFROM 11/25/2022 VALIDTO 11/27/2022 "FREQ=DAILY;INTERVAL=1"
    ( EVERY 0300 EVERYENDTIME 0000 ) 
    :
    END
  • In the following example, an instance of the JOBSTREAM1 job stream runs every three hours on the second working day of the week, starting from November 9 to 11:00 a.m. of December 4.
    SCHEDULE WS_AGT_1#JOBSTREAM1 
    ON RUNCYCLE RC0 VALIDFROM 11/09/2022 VALIDTO 12/03/2022 "FREQ=DAILY;INTERVAL=2;BYWORKDAY" FDIGNORE
    ( EVERY 0300 EVERYENDTIME 1100 +1 DAYS ) 
    :
    WS_AGT_0#JOB_101546603
    
    END

on|except

You can define when a job stream must or must not run using one of the following keywords.

Using the on keyword, you can define when a job stream has to run and how often. It must be placed after the schedule keyword. If you do not specify this keyword, the job stream is not added to the plan.

Using the except keyword, you can specify the days to be excluded by the generated run cycle from the on clause.

Syntax

on

on [runcycle name
[valid from date] [valid to date]
[descriptiontext”]
[vartable table_name]]
{date|day|[folder/]calendar|request|”icalendar”|"cronexpression"} [,...]
[fdignore|fdnext|fdprev][subset subsetname AND|OR]

except

except [runcycle name]
              [validfrom date] [validto date]
              [descriptiontext”]
              {date|day|[folder/]calendar|request|”icalendar”|"cronexpression"}
              [,...]
              [fdignore|fdnext|fdprev][subset subsetname AND|OR]

Arguments

runcycle name
Using this keyword, you can define the name of the run cycle.
valid from date ... valid to date
Using these keywords, you can define the date from which the job stream instance is valid and is added to the production plan, and the date on which the job stream instance must end. The date specified in valid to is not included in the run cycle, so the job stream does not run on that day.
description ”text
Using this keyword, you can specify a description for the run cycle.
vartable
Using this keyword, you can specify the name of the variable table to be used by the run cycle.
date
Using this keyword, you can define specific dates on which the run cycle must run. You can use the following syntax:

yyyymmdd [,yyyymmdd][,...]

In the following example, the job stream is scheduled to run on the 20th of July 2023 and on the 15th of August 2023:
on
20230720,20230815
day
Using this keyword, you can define one or more days on which the run cycle must run. You can use the following syntax:

{mo|tu|we|th|fr|sa|su}

In the following example, the job stream is scheduled to run every Friday:
on
fr
[folder/]calendar
Using this keyword, you can define the dates of a specific calendar, identified by its name. You can use the following syntax after the calendar name to specify an offset:

{+ | -}n {day[s] | weekday[s] | workday[s]}

The following table provides a description of the keywords used in the above syntax:
Keyword Description
n Using this keyword, you can define the number of days, weekdays or workdays.
days Using this keyword, you can specify every day of the week.
weekdays Using this keyword, you can specify the days from Monday to Friday.
workdays By default, using this keyword you can specify the days from Monday to Friday. If you specify different working days, this keyword identifies the days that are not included in the freedays nor in the holidays calendar.
icalendar
Using this keyword, you can set a recurrence rule that defines when the job stream must run. You can use the following syntax:

FREQ={DAILY|WEEKLY|MONTHLY|YEARLY}
[;INTERVAL=[-]n]
[;{BYFREEDAY|BYWORKDAY|BYDAY=weekday_list|
BYMONTHDAY=monthday_list}]

By default, the INTERVAL value is 1. If you specify a value greater than 1, the count of the days starts from the validfrom value defined in the run cycle. If the INTERVAL has not been specified, the count of the days starts from 2020/01/01.

To define the recurrence rule, you can use the syntax described in the iCalendar syntax table:
Table 1. iCalendar syntax
Recurrence rule Syntax Notes
every n days FREQ=DAILY[;INTERVAL=n] The value set for valid from is the first day of the resulting dates.
every free or work days FREQ=DAILY[;INTERVAL=n];BYFREEDAY|BYWORKDAY
every n weeks on specific weekdays FREQ=WEEKLY[;INTERVAL=n]

;BYDAY=weekday_list

;BYDAY=weekday_list
The value set for weekday_list is
[SU][,MO][,TU][,WE][,TH][,FR][,SA]
every n months on specific dates of the month

FREQ=MONTHLY[;INTERVAL=n]

;BYMONTHDAY=monthday_list

The value set for monthday_list is represented by a list of
[+number_of_day_from_beginning_of_month]
[-number_of_day_from_end_of_month]
[number_of_day_of_the_month]
every n months on specific days of specific weeks

FREQ=MONTHLY[;INTERVAL=n]

;BYDAY=day_of_m_week_list

The value set for day_of_m_week_list is represented by a list of
[+number_of_week_from_beginning_of_month]
[-number_of_week_from_end_of_month]
[weekday]
every n years FREQ=YEARLY[;INTERVAL=n] The value set for valid from is the first day of the resulting dates.
Example
  • In the following example, a job stream is scheduled to run every three days:
    FREQ=DAILY;INTERVAL=3
  • In the following example, a job stream is scheduled to run every forth workday:
    FREQ=DAILY;INTERVAL=4;BYWORKDAY
  • In the following example, a job stream is scheduled to run every two weeks on Monday and Tuesday
    FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,TU
  • In the following example, a job stream is scheduled to run every 3 months on the 7th and on the last day of the month:
    FREQ=MONTHLY;INTERVAL=3;BYMONTHDAY=7,-1
  • In the following example, a job stream is scheduled to run every two months on the 3rd Tuesday:
    FREQ=MONTHLY;INTERVAL=2;BYDAY=3TU
  • For a job stream that is scheduled to run every 5 years the value is:
    FREQ=YEARLY;INTERVAL=5
fdignore|fdnext|fdprev
Using this keyword, you can specify the rule to apply if the date selected as exclusion is on a non-working day. The available keywords are:
fdignore
Using this keyword, the date is not added. Do not add the date.
fdnext
Using this keyword, the added date is the nearest workday after the non-working day.
fdprev
Using this keyword, the added date is the nearest workday before the non-working day.

Comments

You can define multiple instances of the on or except keyword for the same job stream, as long as they are consecutive within a job stream definition. Each instance corresponds to a run cycle to which you can add a freeday rule.

Each instance of the keyword can contain any of the values allowed by the on or except syntax.

If the run cycle and job stream start times are both defined, the run cycle start time takes precedence over the job stream. When the job stream is launched with the submit command, the run cycle start time is not used.

Example
  • In the following example, the JOBSTREAM1 job stream runs every eight hours, everyday from February 1, 2023 to 8:00 a.m. of February 10, 2023.
    SCHEDULE WS_AGT_1#JOBSTREAM1 
    FREEDAYS CAL1 -SA
    ON RUNCYCLE RC0 VALIDFROM 02/01/2023 VALIDTO 02/10/2023 "FREQ=DAILY;INTERVAL=1"
    ( EVERY 0800 EVERYENDTIME 0800 ) 
    :
    WS_AGT_0#JOB_101546603
    
    END
    
  • In the following example, the JOBSTREAM1 job stream runs every eight hours only on non-working days starting from February 1, 2023 to 8:00 a.m of February 10, 2023. The job stream runs every eight hours. Saturday is considered a working day as an exception from CAL1 calendar.
    SCHEDULE WS_AGT_1#JOBSTREAM1 
    FREEDAYS CAL1 -SA
    EXCEPT RUNCYCLE RC0 VALIDFROM 02/01/2023 VALIDTO 02/10/2023 "FREQ=DAILY;INTERVAL=1;BYFREEDAY" FDPREV
    ( EVERY 0800 EVERYENDTIME 0800 ) 
    :
    WS_AGT_0#JOB_101546603
    
    END

freedays

Using this keyword, you can define the name of a calendar for non-working days. While defining a run cycle, you can specify if and how a job stream has to run during these days. The freedays calendar is used to calculate the workdays for the job stream. The keyword affects only the job streams in which it is defined.

Syntax

freedays [folder/]Calendar_Name [-sa] [-su]

Arguments

[folder/]Calendar_Name
Using this keyword, you can define the name of the non-working days calendar for the job stream. You cannot use names of weekdays as calendar name. The default calendar holidays is used if the Calendar_Name is not in the database when the schedulr command runs.
-sa
Using this keyword, you define that Saturdays are working days.
-su
Using this keyword, you define that Sundays are working days.

Comments

By default, non-working days calendar includes Saturday and Sunday, unless you specify them as workdays.

If you do not specify freedays, the job stream runs every day, except on Saturday, Sunday and on the days defined in the holidays calendar.

Example
In the following example, the JOBSTREAM1 job stream runs every second working day of the week starting from November 9 to December 3. It runs every three hours until 11.00 of December 4. Saturday is considered a working day as an exception from CAL1 calendar.
SCHEDULE WS_AGT_1#JOBSTREAM1 
FREEDAYS CAL1 -SA
EXCEPT RUNCYCLE RC0 VALIDFROM 11/09/2022 VALIDTO 12/03/2022 "FREQ=DAILY;INTERVAL=2;BYWORKDAY" FDIGNORE
( EVERY 0300 EVERYENDTIME 1100 +1 DAYS ) 
:
WS_AGT_0#JOB_101546603

END