ATS FOR OS/2

Version 3

Getting Started

If you don't read anything else, 
Please Read Me !!!





 
Software And Consulting

































MHR Software And Consulting can be reached
by phone at	(908) 821-0359 or 
by fax at	(908) 821-0350 or 
by mail at 	2227 U.S. Highway # 1
		Suite 146
		North Brunswick, New Jersey 08902

ATS for OS/2 is a valuable trade secret of MHR Software And Consulting and is not to be 
used or disseminated in any manner, or by any means whatsoever, without the express written 
consent of MHR Software And Consulting.

Windows is a trademark of Microsoft Corporation.
 IBM and OS/2 are registered trademarks of International Business Machines Corporation.
 C Set++ is a trademark of International Business Machines Corporation.

Copyright  1993, 1994, MHR Software And Consulting. All Rights Reserved.


Table Of Contents

1. Introduction	1
1.1 Overview	1
1.2 Key Concepts	1
2. Installing ATS	5
3. Starting ATS	7
4. Glossary	9
5. Scheduling Examples	11
5.1 Time Based Task	11
5.2 Event Based Task	13
5.3 Time and Event Based Task	18
5.4 Simple Job Stream	20





This page intentionally left blank.


1. Introduction
During the beta test stage of developing this product, we found that the majority of new ATS 
users needed to be educated in the underlying principles of ATS. Once they understood how 
ATS worked they were immediately able to be productive. This manual, including the provided 
examples have been designed to fulfill that need. Please read this book completely. It has been 
kept brief to encourage you to read it. If you require more detailed information, refer to the ATS 
for OS/2 Version 3 Users Guide or the ATS for OS/2 Version 3 Reference Manual.
1.1 Overview

ATS for OS/2 Version 3 is a very powerful task (i.e. program) scheduling tool for OS/2 2.0 and 
above. With ATS for OS/2 Version 3, you define what type of programs you want to run, when 
you want your programs to be run and how they should be run.

With ATS you specify date, time, day of week and event dependencies for any task that you want 
ATS to run for you automatically. No matter how complicated your scheduling needs, ATS can 
handle it.

At the heart of ATS are three types of entities. They are Events, Tasks and Job Queues. Events 
are something that must happen before a task can be started. A task definition contains all of the 
information required to start a program as well as the set of criteria defining when the program 
can be run. A job queue is an object that is used to control the use of resources and also to 
restrict a flood of tasks from being started at the same time.

Job Queues and Tasks have a one to many relationship and Tasks and Events have a many to 
many relationship. i.e. Each Job Queue can have assigned to it an unlimited number of tasks and 
each task is assigned to only one job queue. Each Task can be dependent upon any number 
(including zero) of events. Each event can be a dependency of any number of tasks.

Chapter 5. Scheduling Examples, contains samples of basic scheduling scenarios including 
step by step procedures for defining each schedule. These samples have been designed to be 
used as templates for creating your own schedule.
1.2 Key Concepts

1.2.1 You do not tell ATS when to run your program, you tell ATS when your 
program is eligible to be run.

While working with ATS, it is extremely important that you remember this. In many cases, there 
might not be a difference between the two methods. However, in many cases you will not be able 
to tell ATS exactly when to run your program, but, you can always tell ATS when your program is 
eligible to be run.

For example, lets assume that we want to create a two task job stream. Job 1 will run at 6:00 AM 
on Wednesdays and Job 2 will run after Job 1 completes. For Job 1, you do not tell ATS to run 
your program on Wednesdays at 6:00 AM, you tell ATS that Job 1 is only eligible to be run at 
6:00 AM and only on Wednesdays. For Job 2, you tell ATS that it is eligible to be run at any time 
of day and any day of the week, but only after Job 1 has completed.

For Job 1, you might think that you are telling ATS when to run you program, and in a way you 
are. However, what you are really telling ATS is when the program is eligible to be run (i.e. it is 
eligible only on Wednesdays and only at 6:00 AM.

This is an important concept because as your scheduling needs get more complicated, ATS will 
be able to handle them, but you must be able to express them the correct way. A task that has 
one or more event dependencies can not be defined by telling ATS precisely when to run that 
task. However, you can easily tell ATS when the task is eligible to be run and then let ATS decide 
when to actually start it.

1.2.2 How do Job Queues effect when a task will actually be run?

When ATS decides that a task should be started, it does not start the task immediately. What it 
does is attempt to add the task to its assigned job queue. If it successfully adds it, then it is up to 
the job queue to decide when the program will actually run. If there are no restrictions on the job 
queue that the task is assigned to, then the task will run immediately. However, if the job queue is 
currently closed or busy (too many concurrent tasks running from the queue), the task will not be 
submitted until the queue is opened and/or the maximum concurrent jobs running in the queue is 
not reached.

1.2.3 When will ATS run my task?

This is really a trick question. The answer is: ATS will start all of the tasks in a job queue, in 
priority order, until the job queues maximum concurrent occurrences has been reached.

The question that you really want to ask is the next one.

1.2.4 When will ATS add my task to its assigned job queue?

On a regular basis, based upon the Clock Check Interval as defined in the Systems Configuration 
Notebook, ATS will interrogate every defined task to determine if it is eligible to be added to its 
assigned job queue. In order for ATS to actually add the task to the job queue, all of the following 
criteria must be satisfied.

*	The tasks maximum concurrent occurrences has not been met.
*	The current month is selected.
*	The current time must be within range.
*	The current date must be within range.
*	The current day of the week must either be:
  set to Run,
  set to Holiday and the current day of the week is defined as a holiday,
  or set to Non-Holiday and the current day of the week is not defined as a holiday.
*	The current day of the month must either be:
  set to Run,
  set to Holiday and the current day of the month is defined as a holiday,
  or set to Non-Holiday and the current day of the month is not defined as a holiday
	OR
  the current day of the month is a special day and the special day is set to Run.
*	All of the dependencies defined to the task, if any, have been satisfied.

If you do not understand these criteria, refer to the ATS for OS/2 Version 3 Users Guide for 
more information about creating tasks in ATS.

1.2.5 Why is my task not running when it should be?

Most of the time it is because you are telling ATS what you think you want it to do and not what 
you really want it to do. Dont take this personally.

Before you go crazy about a task that is not running at the correct time(s), check the schedule. 
There are two ways to do this. You can either go through all of the pages of the Schedule Task 
notebook for the particular task or create  the Tasks report and look at that.

If your task has not been started and you think it should have been, another thing to check is the 
tasks defined job queue. Did ATS try to add your task to its defined job queue and was unable to 
because it was closed? Did ATS successfully add the task to the job queue and it is waiting in the 
job queue to be started? The ATS log will be helpful in determing if this is the case.





This page intentionally left blank.
2. Installing ATS

Note: The ATS for OS/2 Version 3 installation program will delete all files from the target 
directory except for ATS.DAT.

The ATS for OS/2 Version 3 installation program will perform the following functions:

*	Create the target directory, if necessary,
*	Save the ATS for OS/2 Version 2 data file (ATS.DAT),
*	Install all of the required files in the target destination,
*	Create an ATS for OS/2 Version 3 program icon on the OS/2 desktop,
*	Migrate an existing ATS for OS/2 Version 2 data file to the ATS for OS/2 Version 3 format,
*	Start ATS, and
*	Create the Default job queue.

To install ATS for OS/2 Version 3:

1.	Insert the ATS for OS/2 Version 3 diskette into your floppy drive.
2.	In an OS/2 Windowed or Full Screen session, make the floppy drive the current drive.
3.	Type INSTALL and hit the Enter key.
4.	Enter the complete drive and path where you want to install ATS. If the path does not 
exist and can not be created, the installation program will fail.

Note:	For further information on the use of the ATS for OS/2 migration utility (ATSMIG.EXE), refer 
to Appendix E Migrating The ATS Version 2.0 Data File For Use With Version 3 in the 
ATS for OS/2 Version 3 Users Guide.

Note:	If you want to be able to use the ATS for OS/2 Version 3 API interface from a directory 
other than the target directory, you must add the target directory to your LIBPATH 
statement in your CONFIG.SYS file or copy ATS.DLL to a directory in your defined 
LIBPATH.

Note:	If you want to invoke the supplied ATS for OS/2 Version 3 command line interface 
programs from directory other than the target directory, you must add the target directory to 
your PATH statement in your CONFIG.SYS file or copy all of the utility EXE files (not 
ATS.EXE) to a directory in your defined PATH.




This page intentionally left blank.
3. Starting ATS
To run ATS, either double click on the ATS for OS/2 Version 3 icon on the desktop or type ATS 
at the OS/2 command Prompt.

There are 5 optional command line parameters available when starting ATS for OS/2 Version 3. 
These are: INTL, NOWD, MIN, NORESTART and NOREQUEUE. These options are not case 
sensitive.

INTL	This option will cause all of the display dates and times ( i.e. Log Window, Status 
Window, Running Tasks Window and Reports) to be displayed in the international 
date and time format.
	The default date and time format is: MM/DD/YYYY HH:MM:SS. In some areas of 
ATS for OS/2 Version 3, the year portion of the date might omit the century or be 
omitted completely. Likewise, the seconds portion of the time might be omitted.
	With this option specified on the command line, the date and time format is 
changed to: DD.MM.YYYY HH.MM.SS. The same variations that are described 
above (for the default date and time) apply to the international date and time 
format as well.
	With this option specified, the following utility programs supplied with ATS will 
accept a date or time in the international format: ATS_TASK, ATS_JOBQ, 
ATS_HLDY, and ATS_IDBD.
	With this option specified, the following ATS APIs will accept a date or time in the 
international format: ATSAddHoliday, ATSRemoveHoliday, ATSAddTask, 
ATSModifyTask, ATSAddJobQueue, ATSModifyJobQueue and 
ATSIsDateBusinessDay.
MIN	This option will start ATS minimized.
NOREQUEUE	This will prevent any tasks that were waiting in job queues when ATS was 
previously shut down from being re-queued.
NORESTART	This will prevent any tasks that had been running when ATS was previously shut 
down from being started again.
NOWD	This option will prevent the Watchdog warning from appearing even if Watchdog 
is not running and the Suppress The Watchdog Warning option is not selected.
When ATS is invoked, it will copy the ATS.DAT file to another file. This file will be deleted when 
ATS is shutdown. In the case of a system failure (lock up, power failure...), the ATS.DAT file may 
become corrupted since it is an open file. If this occurs, you can then delete the ATS.DAT file and 
rename the backup file.

Note:	When you start ATS, if you are not running Watchdog by MHR Software And Consulting 
a warning message will be displayed indicating that Watchdog is not active. Click on the OK 
button. This has no effect on the performance or functionality of ATS. This is just to remind 
you that if for some reason ATS terminates abnormally, it will not be automatically restarted.

 

Watchdog Warning Message Box
4. Glossary
Dependency	A dependency is a link between an event and a task. An event can be a 
dependency for one or more tasks. A task can be dependent upon one or more 
events. Actually, an event can be defined and not be a dependency of any task 
and a task can be defined without having being dependent upon any event. For 
further information, refer to the ATS for OS/2 Users Guide.
Event	An event is something that happens. This can be either a file being modified (File 
Modification), a file missing (File Missing), the completion of a task that was 
scheduled through and initiated by ATS (Task Completion), a periodic interval 
(Periodic) or notification that something has occurred (Signal Event). ATS events 
are signaled (set) when their attribute criteria have been met. Aside from ATS 
setting events based upon their attributes, events can be set and reset manually 
three ways. These are: from a provided API that has been embedded in an 
application program, running the supplied program ATS_SGNL.EXE or 
ATS_RSET.EXE, or from the SIGNAL EVENTS menu. For further information, 
refer to the ATS for OS/2 Users Guide.
Holiday	Any day of the year can be defined as a holiday. By defining certain days as 
holidays, you are then able to schedule a task to execute on a particular day if it is 
a holiday or if it is not a holiday. For further information, refer to the ATS for OS/2 
Users Guide.
Job Queue	A Job Queue is a task buffer that further controls how and when ATS should run a 
scheduled task. Job queues allow you to set the scheduled tasks priority (when 
running) within the operating system. It also allows you to control the number of 
tasks that ATS will start at any given point. When a task is eligible to be run, ATS 
adds the task to the appropriate job queue. The job queue then decides if the task 
can be started or if it must wait. For further information, refer to the ATS for OS/2 
Users Guide.
Task	A Task is a program that you wish to schedule to be automatically started by ATS. 
The program can be an OS/2 full screen application, an OS/2 windowed 
application, an OS/2 PM application, a DOS windowed application, a DOS full 
screen application or a Windows application. A task can be scheduled to run at a 
certain time of day, on certain days of the week, on certain days of the month, on 
holidays, or not on holidays. In addition, a task can optionally have an unlimited, 
number of dependencies. For further information, refer to the ATS for OS/2 Users 
Guide.




This page intentionally left blank.
5. Scheduling Examples
Each of the following scheduling examples has been designed to reflect a real life situation that 
will be very similar to a scheduling need that you may have.

5.1 Time Based Task

The first example tells ATS to run a particular task at a particular time on a particular day of the 
week.

The second example tells ATS to run a particular task at a particular time on a particular day of 
the month.

5.1.1 Run a compiled OS/2 executable in an OS/2 window at 6:00 in the 
morning every Wednesday.

To create this task, 

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	If no other tasks have been defined yet, the Names & Settings page will be 
displayed for you. If other tasks already exist, click on the New button on the Select 
page of the Tasks notebook. This will cause the Names & Setting Page to be 
displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Set the Earliest Time to 06:00:00 and set the latest time to 06:00:00. This 
tells ATS that the program can only be started at 06:00:00.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week, except Wednesday, to Dont Run.
ii)	Set Wednesday to Run.
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do nothing.
l)	Click on the save button and the task has been created.

5.1.2 Run a compiled OS/2 executable in an OS/2 window at 6:00 in the 
morning on the tenth of every month.

To create this task, 

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	If no other tasks have been defined yet, the Names & Settings page will be 
displayed for you. If other tasks already exist, click on the New button on the Select 
page of the Tasks notebook. This will cause the Names & Setting Page to be 
displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Set the Earliest Time to 06:00:00 and set the latest time to 06:00:00. This 
tells ATS that the program can only be started at 06:00:00.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Dont Run except for the tenth
ii)	Set the tenth to Run..
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do nothing.
l)	Click on the save button and the task has been created.

5.2 Event Based Task

The first example tells ATS to run a particular task when a particular event has occurred.

The second example tells ATS to run a particular task after a set of events have occurred.

5.2.1 Run a compiled OS/2 executable in an OS/2 window every time a 
particular file is modified.

First, create the event that the task is dependent upon.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select File Modification from the Event Type choices.
g)	Enter the fully qualified file name.
h)	Select which modifications that you want this event to be dependent upon. For this 
example, select Date, Time and Size.
i)	Select the file availability. For this example select Both.
j)	Click on Add.
k)	Click on Cancel.

Then create the task.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	If no other tasks have been defined yet, the Names & Settings page will be 
displayed for you. If other tasks already exist, click on the New button on the Select 
page of the Tasks notebook. This will cause the Names & Setting Page to be 
displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Let the Earliest Time and Latest Time fields default to: 00:00:00 and 
23:59:59, respectively.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the event that you defined above and 
click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
l)	Click on the save button and the task has been created.

5.2.2 Run a compiled OS/2 executable in an OS/2 window after two different 
files are modified and another task has completed.

This assumes that the dependent task has already been defined to ATS.

First, create the events that the task is dependent upon.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select File Modification from the Event Type choices.
g)	Enter the fully qualified file name.
h)	Select which modifications that you want this event to be dependent upon. For this 
example, select Date, Time and Size.
i)	Select the file availability. For this example select Both.
j)	Click on Add.
k)	Repeat steps a through j for the other file modification event.
l)	Repeat steps a through e for the job termination then do the following to complete 
the definition of the job termination event.
m)	Select Job Termination from the Event Type choices.
n)	Select the task that must complete from the list of Defined Tasks.
o)	Indicate the minimum and maximum return code from the completed task that will 
allow the event to be signaled.
p)	Click on Add.
q)	Click on Cancel.

Then create the task.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	Click on the New button on the Select page of the Tasks notebook. This will cause 
the Names & Setting Page to be displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Let the Earliest Time and Latest Time fields default to: 00:00:00 and 
23:59:59, respectively.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the first event that we defined above and 
click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
iii)	Repeat steps k.i and k.ii for the second and third event that we defined 
above.
l)	Click on the save button and the task has been created.

5.3 Time and Event Based Task

This example tells ATS to run a particular task after a set of events have occurred but only during 
certain times of the day and only on certain days of the week.

5.3.1 Run a compiled OS/2 executable in an OS/2 window after two different 
files are modified and another task has completed. Because of system 
load, the task can only be executed between 2:00 AM and 5:30 AM 
Monday through Friday.

This assumes that the other task has already been defined to ATS.

First, create the events that the task is dependent upon.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select File Modification from the Event Type choices.
g)	Enter the fully qualified file name.
h)	Select which modifications that you want this event to be dependent upon. For this 
example, select Date, Time and Size.
i)	Select the file availability. For this example select Both.
j)	Click on Add.
k)	Repeat steps a through j for the other file modification event.
l)	Repeat steps a through e for the job termination then do the following to complete 
the definition of the job termination event.
m)	Select Job Termination from the Event Type choices.
n)	Select the task that must complete from the list of Defined Tasks.
o)	Indicate the minimum and maximum return code from the completed task that will 
allow the event to be signaled.
p)	Click on Add.
q)	Click on Cancel.

Then create the task.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	Click on the New button on the Select page of the Tasks notebook. This will cause 
the Names & Setting Page to be displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Set the Earliest Time to 02:00:00 and set the latest time to 05:30:00.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run except Saturday and Sunday.
ii)	Set Saturday and Sunday to Dont Run.
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the first event that we defined above and 
click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
iii)	Repeat steps k.i and k.ii for the second and third event that we defined 
above.
l)	Click on the save button and the task has been created.

5.4 Simple Job Stream

This example tells ATS to run a series of tasks after a particular event has occurred but only on a 
certain day of the week.

5.4.1 We want to run a task, Task 1, at 6:00 AM on Wednesdays. When this 
task is completed, we want to run two additional tasks, Task 2 and Task 
3. When Task 2 completes we want to run Task 4. When Tasks 3 and 4 
have completed we want to run Task 5.

The following diagram illustrates the flow of the tasks.

 

Task Flow

First create Task 1.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	If no other tasks have been defined yet, the Names & Settings page will be 
displayed for you. If other tasks already exist, click on the New button on the Select 
page of the Tasks notebook. This will cause the Names & Setting Page to be 
displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Set the Earliest Time to 06:00:00 and set the latest time to 06:00:00. This 
tells ATS that the program can only be started at 06:00:00.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week, except Wednesday, to Dont Run.
ii)	Set Wednesday to Run.
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do nothing.
l)	Click on the save button and the task has been created.

Next create the Job Termination Event for Task 1.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select Job Termination from the Event Type choices.
g)	Select Task 1 from the list of Defined Tasks.
h)	Indicate the minimum and maximum return code from the completed task that will 
allow the event to be signaled.
i)	Click on Add.
j)	Click on Cancel.

Next create Task 2 and Task 3.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	Click on the New button on the Select page of the Tasks notebook. This will cause 
the Names & Setting Page to be displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Let the Earliest Time and Latest Time fields default to: 00:00:00 and 
23:59:59, respectively.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the event that we defined above as the 
Job Termination event for Task 1 and click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
l)	Click on the save button and the task has been created.
m)	On the Select page, do the following:
i)	Click on the Task 2 entry in the Defined Tasks List Box and then click on 
Copy.
n)	On the Names & Settings page, do the following:
i)	Change the task name to reflect the name of Task 3.
ii)	Change the description to reflect the description of Task 3.
o)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
p)	Click on the save button and the task has been created.

Next create the Job Termination Event for Task 2 and Task 3.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select Job Termination from the Event Type choices.
g)	Select Task 2 from the list of Defined Tasks.
h)	Indicate the minimum and maximum return code from the completed task that will 
allow the event to be signaled.
i)	Click on Add.
j)	Repeat steps c through i for the Job Termination event for Task 3.
k)	Click on Cancel.

Next create Task 4.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	Click on the New button on the Select page of the Tasks notebook. This will cause 
the Names & Setting Page to be displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Let the Earliest Time and Latest Time fields default to: 00:00:00 and 
23:59:59, respectively.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the event that we defined above as the 
Job Termination event for Task 2 and click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
l)	Click on the save button and the task has been created.

Next create the Job Termination Event for Task 4.

a)	Open up the Events Definition screen by selecting Edit on the Main ATS menu and 
then Events... on the Edit menu.
b)	Make sure that you are in Add Mode. If you are in Add Mode, the title bar will say 
ATS for OS/2 - Define Events (Add). If you are not in add mode, the button on the 
lower left will say Add Mode, click it.
c)	Enter a valid event name.
d)	Enter a description of the event.
e)	Make sure Reset on Run is checked.
f)	Select Job Termination from the Event Type choices.
g)	Select Task 4 from the list of Defined Tasks.
h)	Indicate the minimum and maximum return code from the completed task that will 
allow the event to be signaled.
i)	Click on Add.
j)	Click on Cancel.

Next create Task 5.

a)	Open up the Schedule Tasks Notebook by selecting Edit on the Main ATS menu 
and then Tasks... on the Edit menu.
b)	Click on the New button on the Select page of the Tasks notebook. This will cause 
the Names & Setting Page to be displayed.
c)	On the Names & Settings page, do the following:
i)	Enter a valid name for this task.
ii)	Enter a description of the task.
iii)	Select the maximum number of concurrent occurrences of this program that 
can happen. For this example, set it to 1.
iv)	Select the Job Queue to run this task in. For this example, select Default.
v)	Select the priority within the job queue that this task will have. For this 
example, set it to 0.
vi)	Select the Recurring Task radio button to indicate that this task should not be 
deleted from the schedule when the task is started.
d)	On the Months page, do the following:
i)	Make sure that all of the months are selected. This is the default.
e)	On the Dates & Times page, do the following:
i)	Let the Earliest Date and Latest Date fields default to: 01/01/1993 and 
12/31/2025, respectively.
ii)	Let the Earliest Time and Latest Time fields default to: 00:00:00 and 
23:59:59, respectively.
f)	On the Day of Week page, do the following:
i)	Set all of the days of the week to Run (this is the default).
g)	On the Day of Month page, do the following:
i)	Set all of the days of the month to Run (this is the default).
h)	On the Special Days page, do the following:
i)	Leave all of the settings at Dont Run (this is the default).
i)	On the Session Type page, do the following:
i)	Select OS/2 Window for the session type.
ii)	Select Default for the initial size option.
j)	On the Program Details page, do the following:
i)	Enter the name of the program to run.
ii)	Enter any parameters that need to be passed to the program.
iii)	Enter the working directory for the program.
k)	On the Dependencies page, do the following:
i)	In the Defined Events List Box, find the event that we defined above as the 
Job Termination event for Task 3 and click on it to highlight it.
ii)	Click on the Add>> button to add the event to the list of defined events for 
this task.
iii)	In the Defined Events List Box, find the event that we defined above as the 
Job Termination event for Task 4 and click on it to highlight it.
iv)	Click on the Add>> button to add the event to the list of defined events for 
this task.
l)	Click on the save button and the task has been created.





































 
Software And Consulting
ATS for OS/2	Version 3
 

Getting Started	Scheduling Examples
 

 
Page 20

 
	Page 21










