Scheduling Language

Original contents page:






This chapter describes how to create a job stream, based on the scheduling objects defined in the database, using the Composer command line program.


The following shows the structure of a job stream, with keywords in bold.
A job stream begins with a schedule keyword followed by attributes and dependencies.
The colon delimiter introduces the jobs that comprise the job stream. Each job has its own attributes and dependencies.

schedule [cpu#]sched
    [freedays Calendar_Name [-sa] [-su] ]
    on {date| day | calendar | request}[,...] [fdignore | fdnext | fdprev]
    [on {date| day | calendar | request}[,...] [fdignore | fdnext | fdprev]]
    [,...]
    [deadline time [timezone|tz tzname][+day[s] [,...]
    [except{date| day | calendar}[,...] [fdignore | fdnext | fdprev] ] 
    [,...] 
    [at  time[timezone|tz tzname][+ n  day [s] ] ] [,...]
    [carryforward]
    [follows { [cpu#] sched [. job] [,...] } ]
    [keysched]
    [limit number]
    [needs resource]
    [opens file]
    [priority number]
    [prompt name|text]
    [until time [timezone|tz tzname][+day[s]] [onuntil action]
: 
job-statement 
    [at  time[timezone|tz tzname][+ n  day [s] ] ] [,...]
    [confirmed]
    [deadline time [timezone|tz tzname][+day[s] [,...]
    [every rate]
    [follows job|jstream]
    [keyjob]
    [needs resource]
    [opens file]
    [priority number]
    [prompt name|text]
    [until time [timezone|tz tzname][+day[s]] [onuntil action] 
[job-statement...]
end


A brief description of the scheduling keywords is provided in the following table.

Keyword
Description
Page
at
Defines the time of day that job stream or job execution begins.
carryforward
Carries the job stream forward if it is not completed.
comments
Includes comments in a job stream definition
confirmed
Specifies that the completion of this job requires confirmation.
deadline
Specifies the time within which a job or job stream should complete.
end
Marks the end of a job stream.
every
Launches the job repeatedly at a specified rate.
except
Specifies dates that are exceptions to the dates the job stream is selected for execution.
follows
Specifies not to launch this job or job stream until other jobs and job streams have completed successfully.
freedays
Specifies a freeday calendar for calculating workdays for the job stream. It can also set Saturdays and Sundays asworkdays.
job statement
Defines a job and its dependencies.
keyjob
Marks a job as key or critical in both the database and daily plan for monitoring by applications, such as IBM Tivoli Business Systems Manager or Tivoli Enterprise Console(R).
keysched
Marks a job stream as key or critical in both the database and daily plan for monitoring by applications, such as IBM Tivoli Business Systems Manager or Tivoli Enterprise Console.
limit
Sets a limit on the number of jobs that can be launched concurrently from the job stream.
needs
Defines the number of units of a resource required by the job or job stream before it can be launched.
on
Defines the dates on which the job stream is selected for execution.
opens
Defines files that must be accessible before the job or job stream is launched.
priority
Defines the priority for a job or job stream.
prompt
Defines prompts that must be replied to before the job or job stream is launched.
schedule
Assigns a name to the job stream.
until
Defines a time of day after which the job or job stream is not launched.


A dependency is a condition that must be satisfied before a job or job stream is launched. They are to job streams with the follows, needs, opens and prompt keywords.

The maximum number of dependencies permitted for a job or job stream is 40.

The only dependency that is checked immediately before running a job is NEEDS.
An OPENS dependency is automatically considered resolved before the job runs.


With the exception of path names, user names, and UNIX commands, which are case-sensitive, you can use either upper or lower case characters when writing your schedules.


Specifies the job stream name. With the exception of comments, this must be the first keyword in a job stream, and must be followed by the on keyword.
 
Schedules are called as Jobstreams.
 
schedule [wkstation#]jstreamname on …
 
Wkstation
Specifies the name of the workstation on which the job stream is launched. The default is the workstation on which Composer runs to add the job stream.
jstreamname
Specifies the name of the job stream. The name must start with a letter, and can contain alphanumeric characters, dashes, and underscores. It can contain up to 16 characters.
on
Specifies when, or how often, the job stream is selected for execution

 
The following example names a job stream sked1 that runs on the workstation on which Composer is running:

schedule sked1  on tu

The following example names a job stream sked-2 that runs on the workstation on which Composer is running:

schedule sked-2  on everyday  except fr







This is a required job stream keyword that defines when and how often a job stream is selected for execution.
The on keyword must follow the schedule keyword.

 
on {dateday | calendar | request}[,...] [fdignore | fdnext | fdprev][,...]
[on {dateday | calendar | request}[,...] [fdignore | fdnext | fdprev]][,...]
date
Specifies a date in the format, mm/dd/yy.(This can be used when we want to run theb schedule only once on
a specicfic day)

day
A day of the week. You can specify one or more of the following:
mo
Monday
tu
Tuesday
we
Wednesday
th
Thursday
fr
Friday
sa
Saturday
su
Sunday
weekdays
Everyday except Saturday and Sunday
everyday
Every day of the week
workdays
Can be one of the following:
  • If you specified a freedays calendar, workdays are everyday excluding saturday and sunday (unless you specified -sa or -su along with the freedays keyword) and excluding all the dates of the specified freedays calendar.
  • If you did not specify a freedays calendar, workdays are everyday excluding saturday and sunday and excluding all the dates of the holidays calendar.
freedays
The days marked in the freedays calendar, if you specified one.

Example 1:
 
The following example selects job stream sked1 on Mondays and Wednesdays:
schedule sked1 on mo,we

calendar
The dates specified on a calendar by this name. The calendar name can be followed by an offset in the following format:
{+ | -}n {day[s] | weekday[s] | workday[s]}
Where:
n
The number of days, weekdays, or workdays.
days
Stands for every day of the week.
weekdays
Stands for every day of the week, except saturday and sunday.
workdays
Stands for every day of the week, except for Saturdays and Sundays (unless otherwise specified with the freedays keyword) and for the dates marked either in a designated freedays calendar or in the holidays calendar.
Example 2:

The following example selects job stream sked3 on June 15, 1999, and on the dates listed on the apdates calendar:

schedule sked3 on 6/15/99,apdates

Example 3:

The following example selects job stream sked4 two weekdays before each date appearing on the monthend calendar:

schedule sked4 on monthend -2 weekdays

request
Selects the job stream only when requested. This is used for job streams that are selected by name rather than date. To prevent a scheduled job stream from being selected for Jnextday, change its definition to ON REQUEST.
Note:
When attempting to run a job stream that contains "on request" times, consider that:
  • "On request" always takes precedence over "at".
  • "On request" never takes precedence over "on".

freeday rule
Specifies a rule that must be applied when the selected date falls on a freeday. Can be one of the following:
fdignore
Do not run the job stream.
fdnext
Run the job stream on the nearest workday after the freeday.
fdprev
Run the job stream on the nearest workday before the freeday.

Example 4:
 
Select job stream sked1 to run all Mondays, Fridays, and on 29/12/2001. If Mondays and 29/12/2001 are freedays, run the job stream on the nearest following workday. If Fridays are freedays, run the job stream on the nearest preceding day. In this example, the freedays are Saturdays, Sundays, and all the dates listed in the default HOLIDAYS calendar. Workdays are all days from Monday to Friday as long as they are not listed in HOLIDAYS.
schedule sked1
on mo, 29/12/2001 fdnext
on fr fdprev

You can define multiple instances of the on keyword for the same job stream. Each instance is equivalent to a run cycle to which you can associate a freeday rule.
Multiple on instances must be consecutive within the job stream definition.
Each instance of the keyword can contain any of the values allowed by the on syntax.
You must specify the on keyword at least once in the definition of a job stream.


Example 5:
The following example selects job stream testskd1 every weekday except Wednesdays:
schedule testskd1 on weekdays
 
except we

Example 6:

The following example selects job stream testskd3 every weekday except May 15, 1999 and May 24, 1999:
schedule testskd3 on weekdays
 
except 05/16/99,05/24/99

Example 7:
The following example selects job stream testskd4 every day except two weekdays prior to any date appearing on a calendar named monthend:
schedule testskd4 on everyday
  except monthend -2 weekdays





Defines the dates that are exceptions to the on dates of a job stream.
 
except {dateday | calendar } [fdignore | fdnext | fdprev][,...]
[except {dateday | calendar }] [fdignore | fdnext | fdprev][,...]]
date
A date in the format: mm/dd/yy.

Example:
The following example selects job stream testskd3 to run every weekday except May 15,1999 and May 23, 1999:
schedule testskd3 on weekdays
except 05/15/99,05/23/99

day
A day of the week. Specify one or more of the following:
mo
Monday(TM)
tu
Tuesday
we
Wednesday
th
Thursday
fr
Friday
sa
Saturday
su
Sunday
weekdays
Everyday except Saturday and Sunday.
workdays
Can be one of the following:
  • If you specified a freedays calendar, workdays are everyday excluding saturday and sunday (unless you specified -sa or -su along with the freedays keyword) and excluding all the dates of the specified freedays calendar.
  • If you did not specify a freedays calendar, workdays are everyday excluding saturday and sunday and excluding all the dates of the holidays calendar.
freedays
The days marked in the freedays calendar, if you specified one.
calendar
The dates specified on a calendar by this name. The calendar name can be followed by an offset in the following format:
{+ | -}n {day[s] | weekday[s] | workday[s]}
Where:
n
The number of days, weekdays, or workdays.
days
Stands for every day of the week.
weekdays
Stands for every day of the week, except Saturday and Sunday.
workdays
Stands for every day of the week, except for Saturdays and Sundays (unless otherwise specified with the freedays keyword) and for the dates marked either in a designated freedays calendar or in the holidays calendar.

Example:
 
The following example selects job stream testskd2 to run every weekday except those days whose dates appear on calendars named monthend and holidays:
schedule testskd2 on weekdays
except monthend,holidays

Example:
The following example selects job stream testskd4 to run every day except two weekdays prior to any date appearing on a calendar named monthend:
schedule testskd4 on everyday
except monthend-2 weekdays

freeday rule
Specifies a rule that must be applied when the date selected for exclusion falls on a freeday. Can be one of the following:
fdignore
Do not exclude the date.
fdnext
Exclude the nearest workday after the freeday.
fdprev
Exclude the nearest workday before the freeday.

(fd=freeday)

Example:
Select job stream sked4 to run on Mondays, Tuesdays, and 2 weekdays prior to each date listed in the MONTHEND calendar. If the run date is a freeday, run the job stream on the nearest following workday. Do not run the job stream on Wednesdays.
schedule sked4
on mo
on tu, MONTHEND -2 weekdays fdnext
except we



You can define multiple instances of the except keyword for the same job stream.

Multiple except instances must be consecutive within the job stream definition.
Each instance of the keyword can contain any of the values allowed by the except syntax.


Defines the earliest time a job or job stream will be launched.
 
Note that "AT" is not mandatory and can be used with jobs and jobstreams

If an at time is not specified for a job or job stream, its launch time is determined by its dependencies and priority.
The time value in the at option is considered as follows:
  • If the time value is less than the current time, it is taken as for the following day.
  • If the time value is greater than the current time, it is taken as for the current day.
  • If you specify a time value greater than 2400, the value is divided by 2400 to obtain the number of days. If you specify days, these are add to the value obtained by dividing by 2400.


at time [timezone|tz tzname][+day[s]] [,...]
    time
    Specifies a time of day. Possible values can range from 0000 to 2359.
    tzname
    Specifies the time zone to be used when computing the start time.
    The default is the time zone of the workstation on which the job or job stream is launched.
    n
    Specifies an offset in days from the scheduled start date and time.


    Example:

    • The following examples assume that the IBM Tivoli Workload Scheduler processing day starts at 6:00 a.m.

    • The following job stream, selected on Tuesdays, is launched no sooner than 3:00 a.m. Wednesday morning. Its two jobs are launched as soon as possible after that time.
      schedule sked7 on tu at 0300:
      job1
      job2
      End

    (This is same as the recon jobs, which are scheduled to run at 8:00 AM on Thursday.
    As the processing day starts at 16:30 PM, the job actually runs on Friday 8:00 AM CT)

    • The time zone of workstation sfran is defined as Pacific Standard Time (pst), and the time zone of workstation nycity is defined as Eastern Standard Time (est). The following job stream is selected for execution on Friday. It is launched on workstation sfran at 10:00 a.m. pst Saturday. job1 is launched on sfran as soon as possible after that time. job2 is launched onsfran at 2:00 p.m. est (11:00 a.m. pst) Saturday. job3 is launched on workstation nycity at 4:00 p.m. est (1:00 p.m. pst) Saturday.
      sfran#schedule sked8 on fr at 1000 + 1 day :
      job1
      job2 at 1400 tz est
      nycity#job3 at 1600
      end

    Note that its possible to launch jobs of different server in same schedule.


Defines the repetition rate for a job. The job is launched repeatedly at the specified rate. If the job has a dependency that is not satisfied, the iteration is started when the dependency is satisfied.

 
every rate
rate
The repetition rate expressed in hours and minutes, in the format: hhmm. (The rate can be greater than 24 hours.)

If an every job abends , the iteration continues. If the every option is used with the AT dependency, jobs are launched at specific times. If one rerun is delayed (for a dependency or for any other reason) IBM Tivoli Workload Scheduler will realign to the AT time. In this case one or two iterations might not respect the EVERY rate. If the EVERY option is used without the AT dependency, the rerun jobs will be scheduled respecting the EVERY rate specified, starting from the time when the job actually started. IF AND ONLY IF the every option is used with the AT dependency can there be any interactions that do not respect the every rate. For all other cases the every rate is always respected.

Example :

  1. The following example runs the job testjob every hour:
testjob every 100

  1. The following example runs the job testjob1 every 15 minutes, between the hours of 6:00 p.m. and 8:00 p.m.:

testjob1 at 1800 every 15 until 2000

The job will run at 1800, 1815, 1830, and so on. If the job is submitted adhoc at 1833, the reruns will be at 1833,1834,1845 and so on.

  1. The following example does not start the job testjob2 iteration until the job testjob1 has completed successfully:
testjob2 every 15 follows testjob1





Specifies the latest time a job or job stream will be launched.

Until can be used with both jobs and jobstreams(schedules)

 
until time [timezone|tz tzname][+day[s]] [onuntil action]
time
Specifies the time of day. The possible values are 0000 through 2359.

Example 1:
 
The following example prevents sked1 from launching after 5:00 p.m. on Tuesdays:
schedule sked1  on tu  until 1700 :

 
tzname
Specifies the time zone to be used when computing the time.The default is the time zone of the workstation on which the job or job stream is launched.
n
Specifies an offset, in days, from the scheduled date and time.
onuntil action
Specifies the action to be taken on a job or job stream whose until time has expired, but the job or job stream has not yet started. The following are the possible values of the actionparameter:
suppr
The final job stream state is HOLD if the job stream contains at least one every job. Otherwise the final state is calculated using the normal rules and the jobs with the optiononuntil suppr are considered in SUCC state when the until time occurs, even if their dependencies have actually not been released.
cont
The job or job stream runs when all necessary conditions are met and a notification message is written to the log when the until time elapses.
canc
A job or job stream is cancelled when the until time specified expires. Any job or job stream that was dependent on the completion of a job or job stream that was cancelled, will run because the dependency no longer exists.

Example 2:

The following example launches sked1 at 5:00 p.m., when its "until" time expires:
schedule sked1 until 1700 onuntil cont

Example 3:
 
The following example launches job1 between 1:00 p.m. and 5:00 p.m. on weekdays:
schedule sked2  on weekdays :
  job1  at 1300  until 1700
End

Example 4:
 
The following example launches joba every 15 minutes between 10:30 p.m. and 11:30 p.m. on Mondays:
schedule sked3 on mo :
  joba  at 2230  every 0015  until 2330
End

Example 5:
 
The following example launches job stream sked8 on weekdays at 4:00 p.m. and should complete running by 5 p.m. If the job stream is not completed by 5 p.m., it is considered a late job stream. The jobs are to be launched as follows: job1 runs at 4 p.m., or at the latest, 4:20 p.m., at which time, if job1 has not yet started, a notification message is written to the log and it starts running. job 2 runs at 4:30 p.m. or at the latest 4:50 p.m., at which time, if job2 has not yet started, it is cancelled.
schedule sked8 on weekdays at 1600 deadline 1700 :
   job1  at 1600 until 1620 onuntil cont
   job2 at 1630 until 1650 onuntil canc
End

Example 6:

 
The following example launches job stream sked01. When the until event occurs, the job stream sked02 is run because the job stream sked01 is placed in SUCC state. The job stream sked03, instead, is not run because it has a punctual time dependency on job job01 and this dependency has not been released.
SCHEDULE sked01 on everyday:
job01 until   2035 onuntil suppr
end
SCHEDULE sked02 on everyday follows sked01.@
:
job02
end
SCHEDULE sked03 on everyday follows  sked01.Job01
:
job03
END


Defines the other jobs and job streams that must complete successfully before a job or job stream is launched.

 
Use the following syntax for job streams:
follows [netagent::][wkstation#]jstream[.jobname | @] [,...]

Use the following syntax for jobs:
follows [netagent::][wkstation#]jstream{.jobname | @} | jobname [,...]
netagent
The name of the network agent where the inter-network dependency is defined.
wkstation
The workstation on which the job or job stream that must be complete runs. The default is the same workstation as the dependent job or job stream.
jstream
The name of the job stream that must be complete. For a job, the default is the same job stream as the dependent job.
jobname
The name of the job that must be complete. An at sign (@) can be used to indicate that all jobs in the job stream must complete successfully.


Example 1:
 
The following example specifies to not launch job stream skedc until job stream sked4 on workstation site1, and job joba in job stream sked5 on workstation site2 have completed successfully:
schedule skedc on fr
follows site1#sked4,site2#sked5.joba

Example 2:
 
Do not launch sked6 until jobx in the job stream skedx on remote network cluster4 has completed successfully:
sked6 follows cluster4::site4#skedx.jobx

Example 3:
 
The following example specifies to not launch jobd until joba in the same job stream, and job3 in job stream skeda have completed successfully:
jobd follows joba,skeda.job3

Example 4:
 
The following example specifies to not launch jobe until all jobs in job stream skedb on workstation unix1 have completed successfully:
jobe follows unix1#skedb.@



 


Limits the number of jobs that can run simultaneously in a job stream.

limit joblimit

 
joblimit
Specifies the number of jobs that can be running at the same time in the schedule.

Possible values are 0 through 1024. If you specify 0, you prevent all jobs from being launched.

Example:
 
The following example limits to five the number of jobs that can run simultaneously in job stream sked2:
schedule sked2 on fr
  limit 5 :

 


Sets the priority of a job or job stream.
 
priority number | hi | go
number
Specifies the priority. Possible values are 0 through 99. A priority of zero prevents the job or job stream from launching.
hi
The equivalent of priority 100.
go
The equivalent of priority 101, the highest priority.

Example:

The following example illustrates the relationship between job stream and job priorities. The jobs are launched in the following order: job1, job2, joba, jobb.

schedule sked1 on tu
priority 50
:
job1 priority 15
job2 priority 10
end
schedule sked2 on tu
priority 10
:
joba priority 60
jobb priority 50
end
If the job stream priorities were the same, the jobs would be launched in the following order: joba, jobb, job1, job2.






Specifies files that must be available before a job or job stream can be launched.

Can be used with both jobs and jobstreams


opens [wkstation#]"filename" [(qualifier)] [,...]
wkstation
Specifies the name of the workstation or workstation class on which the file exists. The default is the workstation or workstation class of the dependent job or job stream. 
filename
Specifies the name of the file, enclosed in quotation marks. You can use IBM Tivoli Workload Scheduler parameters as part or all of the file name string. If you use a parameter, it must be enclosed in carets (^).
qualifier
Specifies a valid test condition. On UNIX, the qualifier is passed to a test command, which runs as root in bin/sh.
On Windows, the test function is performed as the maestro user. The valid qualifiers are:
-d %p
True if the file exists and is a directory.
-e %p
True if the file exists.
-f %p
True if the file exists and is a regular file.
-r %p
True if the file exists and is readable.
-s %p
True if the file exists and it's size is greater than zero.
-w %p
True if the file exists and is writable.
On both UNIX and Windows, the expression %p, inserts the name of the file.
Entering (notempty) is the same as entering (-s %p). If no qualifier is specified, the default is (-f %p).


Example 1 :

The following example checks to see that file c:\users\fred\datafiles\file88 on workstation nt5 is available for read access before launching ux2#sked6:
schedule ux2#sked6 on tu opens nt5#"c:\users\fred\datafiles\file88"

Example 2:

The following example checks to see if three directories, /john, /mary, and /roger, exist before launching job jobr2:
jobr2  opens "/users"(-d %p/john -a -d %p/mary -a -d %p/roger)

Example 3:

The following example checks to see that file d:\work\john\execit1 on workstation dev3 exists and is not empty, before running job jobt2:
jobt2  opens dev3#"d:\work\john\execit1"(notempty)

Example 4:
The following example checks to see that file c:\tech\checker\startf on workstation nyc exists with a size greater than zero, and is writable, before running job job77:
job77  opens nyc#"C:\tech\checker\startf"(-s %p -a -w %p)

Note that file name is with in ".
%p indicates the file name it self.
 



Defines resources that must be available before a job or job stream is launched.
 
needs [n] [wkstation#]resourcename [,...]
n
Specifies the number of resource units required. Possible values are 0 through 32. The default is one.
Note:
The number of jobs and schedules using a resource at any one time cannot exceed 32.
wkstation
Specifies the name of the workstation on which the resource is locally defined. The default is the workstation of the dependent job or job stream. Resources can be used as dependencies only by jobs and job streams that run on the same workstation as the resource. 
resourcename
Specifies the name of the resource.


Example 1:
 
The following example prevents job stream sked3 from being launched until three units of cputime, and two units of tapes become available:
schedule sked3 on fr
  needs 3 cputime,2 tapes :



The keyjob keyword is used to mark a job as key or critical in both the database and daily plan and for monitoring by applications, such as Tivoli Business Systems Manager.

 
The following example
SCHEDULE cpu1#sched1
ON everyday
KEYSCHED
AT 0100
cpu1#myjob1 KEYJOB
END


The keysched keyword is used to mark a job stream as key or critical in both the database and daily plan and for monitoring by applications, such as Tivoli Business Systems Manager.

 
The following example :
SCHEDULE cpu1#sched1
ON everyday
KEYSCHED
AT 0100
cpu1#myjob1 KEYJOB
END


Makes a job stream eligible to be carried forward to the next day's production plan if it is not completed before the end of the current day's production plan.
 
The following job stream is carried forward if its jobs have not completed before pre-production processing begins for a new day.
schedule sked43 on th
carryforward
:
job12
job13
job13a
end


Includes comments in a job stream definition.

 
*text | <<text>>
*text
Inserts a comment line. The first character in the line must be an asterisk.
<<text>>
Inserts comment text on a line. The text must be enclosed in double angle brackets.

Example 1:

The following example includes both types of comments:
****************************************
* The weekly cleanup jobs
****************************************
*
schedule wkend on fr at 1830
carryforward
:
job1 <<final totals and reports>>
job2 <<update database         >>
end


Specifies that a job's completion must be confirmed by executing a Conman confirm command. 

 
In the following job stream, confirmation of the completion of job1 must be received before job2 and job3 are launched.
schedule test1 on fr:
job1 confirmed
job2 follows job1
job3 follows job1
end


Marks the end of a job stream definition.

Example:
 
schedule test1 on monthend
:
job1
job2
job3
end << end of job stream >>


Job statements place jobs in a job stream and define job dependencies. 

 
[wkstation#]jobname
[description "text"]
[scriptname filename docommand "commandline"][streamlogon username]
[interactive]
[rccondsucc "Success Condition"]
[recovery {stop | continue | rerun}
          [after [wkstation#]jobname
        [abendprompt "text"] ]
[job-dependency [,...]]
wkstation
Specifies the name of the workstation or workstation class on which the job runs. The default is the workstation on which the job stream runs. The pound sign (#) is a required delimiter. 

jobname
Specifies the name of the job. The name must start with a letter, and can contain alphanumeric characters, dashes and underscores. It can contain up to 40 characters.

description
A free-form description of the job, enclosed in double quotes.

scriptname filename
Specifies the name of the file the job runs. Use scriptname for UNIX and Windows jobs. For an executable file, enter the file name and any options and arguments. The length of filenameplus the length of Success Condition (of the rccondsucc keyword) must not exceed 4095 characters. You can also use IBM Tivoli Workload Scheduler parameters. If spaces or special characters are included, other than slashes (/) and backslashes (\), the entire string must be enclosed in quotes (").

docommand command
Specifies a command that the job runs. Enter a valid command and any options and arguments enclosed in quotes ("). The length of command plus the length of Success Condition (of therccondsucc keyword) must not exceed 4095 characters. A command is run directly and, unlike scriptname, the configuration script, jobmanrc, is not run. Otherwise, the command is treated as a job, and all job rules apply. You can also enter IBM Tivoli Workload Scheduler parameters.

streamlogon
The user name under which the job runs. The name can contain up to 47 characters. If the name contains special characters it must be enclosed in quotes ("). Specify a user that can log on to the workstation on which the job runs. You can also enter IBM Tivoli Workload Scheduler parameters.

rccondsucc "Success Condition"

An expression which determines the return code (RC) required to consider a job successful. The success condition maximum length must be 256 characters. This expression can contain a combination of comparison and boolean expressions:

Comparison expression
Specifies the job return codes. The syntax is:
(RC operator operand)
RC
The RC keyword.
operator
Comparison operator. It can have the following values:
Example
Operator
Description
RC<a
<
Less than
RC<=a
<=
Less than or equal to
RC>a
>
Greater than
RC>=a
>=
Greater than or equal to
RC=a
=
Equal to
RC!=a
!=
Not equal to
RC<>a
<>
Not equal to

operand
An integer between -2147483647 and 2147483647.
For example, you can define a successful job as a job that ends with a return code less than or equal to 3 as follows:
rccondsucc "(RC <= 3)"

Boolean expression
Specifies a logical combination of comparison expressions. The syntax is:
comparison_expression operator comparison_expression
comparison_expression
The expression is evaluated from left to right. You can use parentheses to assign a priority to the expression evaluation.
operator
Logical operator. It can have the following values:

Example
Operator
Result
expr_a and expr_b
And
TRUE if both expr_a and expr_b are TRUE.
expr_a or expr_b
Or
TRUE if either expr_a or expr_b is TRUE.
Not expr_a
Not
TRUE if expr_a is not TRUE.
For example, you can define a successful job as a job that ends with a return code less than or equal to 3 or with a return code not equal to 5, and less than 10 as follows:
rccondsucc "(RC=3) OR ((RC>=5) AND (RC<10))"
job-dependency
Specifies scheduling keywords and arguments. The valid keywords for jobs are: at, confirmed, every, follows, needs, opens, priority, prompt, and until.


Using Parameters in Job Definitions
Parameters have the following uses and limitations in job definitions:
  • Parameters are allowed in the streamlogon, scriptname, and docommand values.
  • A parameter can be used as an entire string or a part of it.
  • Multiple parameters are permitted in a single variable.
  • Enclose parameter names in carets (^), and enclose the entire string in quotation marks.

A job needs to be defined only once in the database, and can be used in multiple job streams. When a job stream is added or modified, the attributes or recovery options of its jobs are also added or modified.

When defining jobs, keep the following in mind:
  • Jobs can be defined independently (as described in Job definitions), or as part of job streams. In either case, the changes are made in the database and do not affect the production plan until the start of a new processing day.
  • When you add or replace a job stream, any job modifications affect all other job streams that use the jobs. Note that the Cross Reference Report can be used to determine the names of job streams in which a particular job is included.

Examples

The following example defines a job stream with three previously defined jobs:
schedule bkup on fr at 20:00 :
  cpu1#jbk1
  cpu2#jbk2
    needs 1 tape
  cpu3#jbk3
    follows jbk1
end


The following job stream definition contains job statements that add or modify the definitions of two jobs in the database:
schedule sked4 on mo :
  job1  scriptname "d:\apps\maestro\scripts\jcljob1"
    streamlogon jack
    recovery stop abendprompt "continue production"
  site1#job2  scriptname "d:\apps\maestro\scripts\jcljob2"
    streamlogon jack
    follows job1
end



Specifies the time within which a job or job stream must complete. Jobs or job streams that have not yet started or that are still running when the deadline time has expired, are considered late in the plan. When a job (or job stream) is late, the following actions are performed:
  • Job is shown as late in Conman and Job Scheduling Console.
  • An event is sent to the Tivoli Enterprise Console and the IBM Tivoli Business Systems Manager.
  • A message is issued to the stdlist and console logs.


deadline time [timezone|tz tzname][+day[s] [,...]
time
Specifies a time of day. Possible values can range from 0000 to 2359.
tzname
Specifies the time zone to be used when computing the deadline.
The default is the time zone of the workstation on which the job or job stream is launched.
n
Specifies an offset in days from the scheduled deadline time.

Example:

The following example launches job stream sked7 everyday and job jobc to start running at 14:30 and to be completed by 16:00.
schedule sked7 on everyday :
    jobc at 1430 deadline 1600
end

3 comments:

  1. Hi, great article.
    I have one question, I'm new to maestro

    I need to schedule a job, which runs daily at 0600 and 2100
    This job restarts an application of mine,

    can you advise how I can define my schedule in composer?

    ReplyDelete
    Replies
    1. 1. Define your schedule in a text file.
      2. Save your schedule to a text file.
      3. Upload text file to TWS-accessible location.
      4. Then use the Add command to add.

      composer add /home/a1234/MySchedule.txt

      Delete
  2. Hi, How do I use RUNCYCLE to schedule a monthly job that runs 2 working days before the end of each month

    ReplyDelete