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][+n 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][+n day[s]] [onuntil action]
:
job-statement
[at time[timezone|tz tzname][+ n day [s] ] ] [,...]
[confirmed]
[deadline time [timezone|tz tzname][+n day[s] [,...]
[every rate]
[follows job|jstream]
[keyjob]
[needs resource]
[opens file]
[priority number]
[prompt name|text]
[until time [timezone|tz tzname][+n 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.
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.
|
Defines the dates that are
exceptions to the on dates of a job stream.
|
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:
|
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.
|
Specifies the latest time a job
or job stream will be launched.
Until can be used with both jobs and
jobstreams(schedules)
|
Defines
the other jobs and job streams that must complete successfully before a job
or job stream is launched.
|
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.
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.
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
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.
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.
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.
|
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:
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 |
Hi, great article.
ReplyDeleteI 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?
1. Define your schedule in a text file.
Delete2. 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
Hi, How do I use RUNCYCLE to schedule a monthly job that runs 2 working days before the end of each month
ReplyDelete