ATS FOR OS/2

Version 3


CLI and API
Reference Manual



 
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. Overview	1
2. Command Line Interface	3
2.1. ATS_BLKQ	3
2.2. ATS_EVNT	3
2.3. ATS_FLSH	5
2.4. ATS_HLDY	5
2.5. ATS_IDBD	6
2.6. ATS_JOBQ	6
2.7. ATS_LINK	8
2.8. ATS_RSET	9
2.9. ATS_SGNL	9
2.10. ATS_TASK	10
2.11. ATS_TCNT	12
2.12. ATSMIG	13
2.13. ATSREORG	13
2.14. ATSSTOP	13
2.15. ATSTOLOG	14
3. Application Programming Interface	15
3.1. ATSAddEvent	15
3.2. ATSAddHoliday	15
3.3. ATSAddJobQueue	15
3.4. ATSAddTask	15
3.5. ATSAddTaskEventLink	16
3.6. ATSAddToLog	16
3.7. ATSBlockJobQueue	16
3.8. ATSFlushQueue	16
3.9. ATSFlushTask	17
3.10. ATSInitJobQueueData	17
3.11. ATSInitTaskData	17
3.12. ATSIsDateBusinessDay	17
3.13. ATSModifyJobQueue	18
3.14. ATSModifyTask	18
3.15. ATSQueryActiveTaskCount	18
3.16. ATSRemoveEvent	18
3.17. ATSRemoveHoliday	19
3.18. ATSRemoveJobQueue	19
3.19. ATSRemoveTask	19
3.20. ATSRemoveTaskEventLink	19
3.21. ATSResetEvent	20
3.22. ATSSignalEvent	20
3.23. ATSStop	21
3.24. PrintATSAPIErrMsg	21
4. ATS API Structures	23
4.1. ATS_BLOCK_JOBQ_DATA	23
4.2. ATS_EVENT_DATA	23
4.3. ATS_FILE_EVENT_DATA	24
4.4. ATS_FLUSH_JOBQ_DATA	24
4.5. ATS_HOLIDAY_DATA	25
4.6. ATS_JOBQ_DATA	25
4.7. ATS_JOB_EVENT_DATA	27
4.8. ATS_LINK_DATA	28
4.9. ATS_PERIODIC_EVENT_DATA	28
4.10. ATS_TASK_DATA	29
4.11. WHEN_TO_RUN	32
5. API to External Interface Cross Reference	35
6. Samples	37
6.1. ATS_SGNL.C	37
6.2. ATS_SGNL.MAK	39
6.3. ATS_SGNL.DEP	39
6.4. ATS_RSET.C	40
6.5. ATS_RSET.MAK	42
6.6. ATS_RSET.DEP	42
6.7. ATSCALL.CBL	43


1. Overview
In version 2 of ATS for OS/2, the command line and API interfaces, by design, 
were limited. The initial requirements only defined the ability to set and reset 
Signal Events from outside of the ATS user interface.

However, as with most software products, sophisticated users wanted more. 
One of the most requested enhancements to ATS concerned the command line 
and Api interfaces. Users wanted to be able to control the schedule maintained 
by ATS from their own programs. Although the command line and API 
interfaces are now quite comprehensive, they are not 100 percent 
encompassing and will be enriched in future releases. Almost all of the 
capabilities provided by the Presentation Manager interface are available 
through the command line and API interfaces.

This manual is intended to be used by those individuals who want to 
incorporate the control of ATS into their own programs. The command line 
interface programs (ATS Utility programs) can be run from an OS/2 Command 
Line (Full Screen or Windowed) or embedded in an OS/2 Command Procedure 
or REXX program. The API interface calls can be embedded within a user 
written program. The APIs were designed to be called from a C program (i.e. 
all character strings require null terminators) but they have also been tested, 
and found to be compatible, with programs written in COBOL.

ATS and all of the utility programs included with it were written in C and 
compiled using IBMs C Set++ for OS/2.

Chapter 2. ATS External Interface defines all of the utility programs provided 
with ATS. For each program, the following information is presented: the related 
ATS API(s), a description of the programs function, the syntax for invoking the 
program, a description of all of the parameters, notes on the use of the 
program, and at least one example of how the program can be invoked.

Chapter 3. ATS Programming Reference defines all of the APIs provided 
with ATS. For each API, the following information is presented: the related ATS 
utility program (EXE), a description of the APIs function, the syntax for using 
the API, a description of all of the parameters, notes on the use of the API.

Chapter 4. ATS API Structures defines all of the data structures that are used 
by the ATS APIs. The structures are declared in the file ATSDLL.H. For each 
structure, the following information is presented: the layout of the structure, a 
description of each of the fields in the structure and notes on the use and 
loading of the structure.

Chapter 5. API to External Interface Cross Reference presents a concise list 
of all of the APIs and utility programs and cross references them.

Chapter 6. Samples contains the source code, make and dependency files for 
ATS_SGNL and ATS_RSET as well as a program written in COBOL called 
ATSCALL which calls the ATSAddHoliday API.
2. Command Line Interface
2.1. ATS_BLKQ
Related API(s):	ATSBlockJobQueue
Description:	Blocks or unblocks a job queue.
Syntax:	ATS_BLKQ action queuename
Parameters:	action:	B, U (Block queue or Unblock queue)
	queuename:	Name of Job Queue.
Notes:	
Example(s):	ats_blkq B JobQueue01
	ats_blkq U JobQueue01

2.2. ATS_EVNT
Related API(s):	ATSAddEvent
	ATSRemoveEvent
Description:	Defines an event to ATS, deletes a previously defined event or 
modifies the definition of a previously defined event.
Syntax:	ATS_EVNT action eventname J resetonrun taskname minRC 
	maxRC description
	ATS_EVNT action eventname F resetonrun filename 
	changecriteria availabilityoption description
	ATS_EVNT action eventname S resetonrun description
	ATS_EVNT action eventname P resetonrun basedate basetime 
	interval intervaltype description
	ATS_EVNT action eventname M resetonrun filename 
	description

Parameters:	action:	A, D	(add or delete event)
	eventname:	Name of Event.
	resetonrun:	Default Reset On Run value for the event.
	taskname:	Name of the task that the Job Termination 	
		event is dependent upon.
	minRC:	Minimum return code from the task that will 	
		satisfy this Job Termination event.
	maxRC:	Maximum return code from the task that will 
		satisfy this Job Termination event.
	filename:	The name of the file that the File Modification 
		or File Missing event is dependent upon.
	changecriteria:	A string of any combination of D, T, S, R, H, Y 
		or A concatenated together. They stand for: 
		Date, Time, Size, Read only, Hidden, sYstem 
		and Archived, respectively.
	availabilityoption:	Any one of R, W, B or N. They stand for: 	
		Read, Write, Both and None, respectively.
	basedate:	Valid date in the format: mm/dd/yyyy.
	basetime:	Valid time in the format: hh:mm:ss.
	interval:	Integer between 1 and 999.
	intervaltype:	Either S, M, H, D or W. They stand for: 	
		Seconds, Minutes, Hours, Days and Weeks, 
		respectively.
	description:	Event description. Embedded spaces are 	
		allowed.
Notes:	Each of the five versions of the syntax will create or delete one 
particular type of event. The first version will create a Job 
Termination event, the second version will create a File 
Modification event, the third version will create a Signal event, the 
fourth version will create a Periodic event and the fifth version will 
create a File Missing event.
	Only the action and eventname parameters are required when 
deleting an event.
	If ATS is started with the INTL command line parameter, then ATS 
will accept the base parameter for this program if it is in the 
standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, then ATS 
will accept the basetime parameter for this program if it is in the 
standard format (hh:mm:ss) or the international format (hh.mm.ss).
Example(s):	ats_evnt A EventP01 P R 03/01/1994 00:00:00 60 M Expires every 
60 Minutes
	ats_evnt A EventS01 S R Start of test
	ats_evnt A EventF01 F R G:\CONFIG.SYS DTS B Modification of 
G:\CONFIG.SYS
	ats_evnt A EventM01 M R G:\CONFIG.SYS G:\CONFIG.SYS 
Missing
	ats_evnt A EventT10 J R T07 -9999 99999 End of T07
	ats_evnt D EventS01
2.3. ATS_FLSH
Related API(s):	ATSFlushQueue
	ATSFlushTask
Description:	Removes all queued tasks from a job queue or removes a 
particular task from a job queue.
Syntax:	ATS_FLSH jobqueuename taskname
Parameters:	jobqueuename:	Name of the Job Queue to remove the 	
		task(s) from.
	taskname:	Name of the task to remove from the job 	
		queue.
Notes:	If the task name is omitted, all of the tasks in the specified job 
queue will be removed.
Example(s):	ats_flsh JobQueue1 Task01
	ats_flsh JobQueue1
2.4. ATS_HLDY
Related API(s):	ATSAddHoliday
	ATSRemoveHoliday
Description:	Defines a new holiday to ATS and deletes a previously defined 
holiday.
Syntax:	ATS_HLDY action date description
Parameters:	action:	A, D	(add or delete holiday)
	date:	Valid date in the format: mm/dd/yyyy.
	description:	Event description. Embedded spaces are 	
		allowed.
Notes:	Only the action and date parameters are required when deleting a 
holiday.
	If ATS is started with the INTL command line parameter, then ATS 
will accept the date parameter for this program if it is in the 
standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).
Example(s):	ats_hldy A 01/01/0000 New Years Day
	ats_hldy D 01/01/0000
2.5. ATS_IDBD
Related API(s):	ATSIsDateBusinessDay
Description:	Returns a flag indicating whether or not a particular date is a 
business day based upon defined holidays and weekly business 
days.
Syntax:	ATS_IDBD date
Parameters:	date:	Valid date in the format: mm/dd/yyyy.
Notes:	If ATS is started with the INTL command line parameter, then ATS 
will accept the date parameter for this program if it is in the 
standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).

Example(s):	ats_idbd 11/14/1994
2.6. ATS_JOBQ
Related API(s):	ATSAddJobQueue
	ATSRemoveJobQueue
	ATSModifyJobQueue
Description:	Defines a job queue to ATS, deletes a previously defined job 
queue or modifies the definition of a previously defined job queue.
Syntax:	ATS_JOBQ action jobqueuename [/MC:maxconcur] [/D1:startdate] 
	[/D2:enddate] [/T1:starttime] [/T2:endtime] [/D:description] 	
	[/MO:months] [/DW:daysoftheweek] [/DM:daysofthemonth] 
	[/SD:specialdays] [/PC:priorityclass] [/PD:prioritydelta] [/B]
Parameters:	action:	A, M, D	(add, modify or delete job 	queue)
	jobqueuename	Name of the Job Queue.
	maxconcur:	Integer between 1 and 99.
	startdate:	Valid date in the format: mm/dd/yyyy.
	enddate:	Valid date in the format: mm/dd/yyyy.
	starttime:	Valid time in the format: hh:mm:ss.
	enddtime:	Valid time in the format: hh:mm:ss.
	months:	The string ALL for all months or any 		
		combination of the strings: JAN, FEB, 	
		MAR, APR, MAY, JUN, JUL, AUG, SEP, 	
		OCT, NOV, DEC concatenated together.
	daysoftheweek:	A seven character string. Each position 	
		represents a day of the week. The first 	
		position is Sunday and the last is Saturday. 
		Each position can be either R, D, H or N for: 
		Run, Don't run, run if it is a Holiday and run if it 
		is Not a holiday, respectively.
	daysofthemonth:	A thirty one character string. Each position 	
		represents a day of the month. The first 	
		position is the first of the month and the last 
		position is the 31st of the month. All 31 	
		characters must be supplied regardless of the 
		actual number of days in a month. Each 	
		position can be either R, D, H or N for: Run, 
		Don't run, run if it is a Holiday and run if it is 
		Not a holiday, respectively.
	specialdays:	A five character string. Each position 	
		represents an ATS special day. The first 	
		position is the last day fo the month, the 	
		second position is the first business day of the 
		month, the third position is the last business 
		day of the month, the fourth position is the last 
		business day before the fifteenth of the month 
		and the last position is the first business day 
		after the fifteenth of the month. Each position 
		can be either R or D for: Run and Don't run, 
		respectively.In addition, the first position can 
		also be either H or N for: run if it is a Holiday 
		and run if it is Not a holiday, respectively.
	priorityclass:	Either I, R, S, C, or T for Idle time, Regular, 
		Server, time Critical and don't change the Task 
		priority, respectively.
	prioritydelta:	A signed integer between -31 and +31.
	description:	Job Queue description. Embedded spaces are 
		allowed.
	/B		Blocked flag. If specified, the job queue will be 
		initially blocked.
Notes:	Only the action and jobqueuename parameters are required when 
deleting a job queue.
	Parameters surrounded by [ ] are optional. They will default if not 
specified.
	If ATS is started with the INTL command line parameter, then ATS 
will accept the startdate and enddate parameters for this program if 
it is in the standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, then ATS 
will accept the starttime and endtime parameters for this program if 
it is in the standard format (hh:mm:ss) or the international format 
(hh.mm.ss).
Example(s):	ats_jobq A Default /D:Default Queue /B /PC:R /PD:0 /MC:99 
/D1:01/01/1993 /D2:12/31/2025 /T1:00:00:00 /T2:23:59:59 
/DW:RRRRRRR 
/DM:RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 
/SD:DDDDD 
/MO:JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
	ats_jobq D Default
	ats_jobq M Default /D:Default Queue /B /PC:R /PD:0 /MC:99 
/D1:01/01/1993 /D2:12/31/2025 /T1:00:00:00 /T2:23:59:59 
/DW:RRRRRRR 
/DM:RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 
/SD:DDDDD 
/MO:JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
2.7. ATS_LINK
Related API(s):	ATSAddTaskEventLink
	ATSRemoveTaskEventLink
Description:	Defines a new link between a defined task and event or deletes a 
previously defined link between a defined task and event.
Syntax:	ATS_LINK action taskname eventname
Parameters:	action:	A, D	(add or delete holiday)
	taskname:	Name of the task that is getting or losing a 	
		dependency.
	eventname:	Name of the event that is being added or 	
		removed from the task.
Notes:	
Example(s):	ats_link A Task01 EventP01
	ats_link D Task01 EventP01
2.8. ATS_RSET
Related API(s):	ATSResetEvent
Description:	Resets an event globally, resets an event for a task or resets all 
events for a task.
Syntax:	ATS_RSET option name1 name2
Parameters:	option:	T, E or B (reset all events for a task, reset 	
		one event for all tasks or reset one event for 
		one task, respectively).
	name1:	Event name for options E and B, task 	
		name for option T 
	name2:	Omitted for options T and E, event name for 
		option B
Notes:	ATS is case sensitive. If you define an event name in upper, lower, 
or mixed case, you must supply the text in the event name 
parameter in the same case. If you define a task name in upper, 
lower, or mixed case, you must supply the text in the text name 
parameter.
Example(s):	ats_rset E EventP01
	ats_rset B EventP01 Task01
	ats_rset T Task01
2.9. ATS_SGNL
Related API(s):	ATSSignalEvent
Description:	Signals an event globally, signals an event for a task or signals all 
events for a task.
Syntax:	ATS_SGNL option name1 name2
Parameters:	option:	T, E or B (signal all events for a task, 	
		signal one event for all tasks or signal 	
		one event for one task, respectively).
	name1:	Event name for options E and B, task 	
		name for option T
	name2:	Omitted for options T and E, event name for 
		option B
Notes:	ATS is case sensitive. If you define an event name in upper, lower, 
or mixed case, you must supply the text in the event name 
parameter in the same case. If you define a task name in upper, 
lower, or mixed case, you must supply the text in the text name 
parameter.
Example(s):	ats_sgnl E EventP01
	ats_sgnl B EventP01 Task01
	ats_sgnl T Task01
2.10. ATS_TASK
Related API(s):	ATSAddTask
	ATSRemoveTask
	ATSModifyTask
Description:	Defines a task to ATS, deletes a previously defined task or 
modifies the definition of a previously defined task.
Syntax:	ATS_TASK action taskname /PN: programname [/P:parameters] 
	[/W:workingdirectory] [/SR:singleorreccurring] 
	[/MC:maxconcur][/D1:startdate] [/D2:enddate] [/T1:starttime] 
	[/T2:endtime] [/S:sessiontype] [/Q:jobqueuename] 
	[/QP:priorityinqueue] [/D:description] [/MO:months] 
	[/DW:daysoftheweek] [/DM:daysofthemonth] [/SD:specialdays] 
	[/I] [/C] [/B] [/E1:eventname] [/E2:eventname] [/E3:eventname] 
	[/E4:eventname] [/E5:eventname]
Parameters:	action:	A, M, D	(add, modify or delete task)
	taskname	Name of the Task.
	programname:	Name and path of the program that is to be 	
		run.
	parameters:	Parameters to be passed to the program. 	
		Embedded spaces are allowed as are ATS 	
		replacement variables.
	workingdirectory:	Working directory for the program.
	sessiontype:	Type of session to start the program in. This 
		can be either: FS, VIO, PM, VDM, WVDM, 	
		W31COMM, W31PRIV or Default for OS/2 Full 
		Screen, OS/2 Window, Presentation Manager, 
		DOS Full Screen (Virtual DOS Machine), DOS 
		Window (WIndowed Virtual DOS Machine), 
		Common WIN-OS/2, Private WIN-OS/2 or the 
		Default for the task, respectively.
	jobqueuename:	Name of the already defined Job Queue that 
		this task will be assigned to.
	priorityinqueue:	The priority within the job queue that this task 
		will have.
	maxconcur:	Integer between 1 and 99.
	startdate:	Valid date in the format: mm/dd/yyyy.
	enddate:	Valid date in the format: mm/dd/yyyy.
	starttime:	Valid time in the format: hh:mm:ss.
	enddtime:	Valid time in the format: hh:mm:ss.
	months:	The string ALL for all months or any 		
		combination of the strings: JAN, FEB, MAR, 
		APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, 
		DEC concatenated together.
	daysoftheweek:	A seven character string. Each position 	
		represents a day of the week. The first position 
		is Sunday and the last is Saturday. Each 	
		position can be either R, D, H or N for: Run, 
		Don't run, run if it is a Holiday and run if it is 
		Not a holiday, respectively.
	daysofthemonth:	A thirty one character string. Each position 	
		represents a day of the month. The first 	
		position is the first of the month and the last 
		position is the 31st of the month. All 31 	
		characters must be supplied regardless of the 
		actual number of days in a month. Each 	
		position can be either R, D, H or N for: Run, 
		Don't run, run if it is a Holiday and run if it is 
		Not a holiday, respectively.
	specialdays:	A five character string. Each position 	
		represents an ATS special day. The first 	
		position is the last day fo the month, the 	
		second position is the first business day of the 
		month, the third position is the last business 
		day of the month, the fourth position is the last 
		business day before the fifteenth of the month 
		and the last position is the first business day 
		after the fifteenth of the month. Each position 
		can be either R or D for: Run and Don't run, 
		respectively.In addition, the first position can 
		also be either H or N for: run if it is a Holiday 
		and run if it is Not a holiday, respectively.
	description:	Taskdescription. Embedded spaces are 	
		allowed.
	/B		Background flag. If specified, the task will be a 
		background task.
	/C		Command file flag. If specified, the task will be 
		assumed to be an OS/2 Command Procedure 
		or a REXX program.
	/I		Independent Session flag. If specified, the task 
		will be started as an independent session.
	eventname:	Name of an already defined event. The event 
		will be added as a dependency for this task 
		when the task is created. You can define up to 
		five dependencies when createing a task.
Notes:	Only the action and taskname parameters are required when 
deleting a task.
	Parameters surrounded by [ ] are optional. They will default if not 
specified.
	If ATS is started with the INTL command line parameter, then ATS 
will accept the startdate and enddate parameters for this program if 
it is in the standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, then ATS 
will accept the starttime and endtime parameters for this program if 
it is in the standard format (hh:mm:ss) or the international format 
(hh.mm.ss).
Example(s):	ats_task A Task01 /D:Backup /PN:G:\ATS\ATSTOLOG.EXE 
/P:"Backup 2 Completed. RC=0" /W:G:\ATS /Q:Server /QP:0 /B 
/S:VIO /SR:R /MC:1 /E1:ET-10/D1:01/01/1993 /D2:12/31/2025 
/T1:00:00:00 /T2:23:59:59 /DW:RRRRRRR 
/DM:RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 
/SD:DDDDD 
/MO:JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
	ats_task D Task01
	ats_task M Task01 /D:Backup /PN:G:\ATS\ATSTOLOG.EXE 
/P:"Backup 2 Completed. RC=0" /W:G:\ATS /Q:Server /QP:0 /B 
/S:VIO /SR:R /MC:1 /E1:ET-10 /D1:01/01/1993 /D2:12/31/2025 
/T1:00:00:00 /T2:23:59:59 /DW:RRRRRRR 
/DM:RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 
/SD:DDDDD 
/MO:JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
2.11. ATS_TCNT
Related API(s):	ATSQueryActiveTaskCount
Description:	Returns the number of currently active tasks initiated by ATS.
Syntax:	ATS_TCNT
Parameters:	none
Notes:	
Example(s):	ats_tcnt
2.12. ATSMIG
Related API(s):	N/A
Description:	Migrates the ATS Version 2 data file (ATS.DAT) to be compatible 
with ATS Version 3.
Syntax:	ATSMIG
Parameters:	none
Notes:	ATSMIG.EXE will read a data file, ATS.DAT, that was created by 
ATS for OS/2 Version 2 and create a file called ATS.D3T. If a file 
with the name ATS.D3T already exists in the current directory, 
ATSMIG.EXE will fail.
	ATSMIG.EXE will create a file called ATSMIG.LOG with 
information on what it found and what it did.
Example(s):	atsmig
2.13. ATSREORG
Related API(s):	N/A
Description:	Removes any free space from the ATS data file (ATS.DAT).
Syntax:	ATSREORG
Parameters:	none
Notes:	ATSREORG.EXE will read the ATS.DAT file (where all of the 
schedule information is stored) and create a new file called 
ATS.DA2. During this process, all of the free space that was in the 
data file will be removed. For effeciency, new entities are added at 
the end of the file. If you delete entities, that space will not be 
reused. Use ATSREORG.EXE to recalim this space.
Example(s):	atsreorg
2.14. ATSSTOP
Related API(s):	ATSStop
Description:	Causes an orderly shut down of ATS.
Syntax:	
Parameters:	None
Notes:	ATSSTOP.EXE is an executable that will cause ATS to gracefully 
terminate. This executable is provided to give you the ability to 
stop ATS from a rexx program, command file or OS/2 prompt. It is 
strongly advised by MHR Software And Consulting that this 
feature be used with extreme caution. When ATS for OS/2 is 
stopped, any program that was started by ATS for OS/2, except 
those defined to be run in an independent session, will also be 
stopped.
Example(s):	atsstop
2.15. ATSTOLOG
Related API(s):	ATSAddToLog
Description:	Adds a text message to the ATS log. The message is prepended 
with a double asterisk "**" to indicate that it came from the API.
Syntax:	ATSTOLOG string
Parameters:	string:	The text that you want to insert into the ATS 
		log.
Notes:	The text string will be prefaced with '** ' (two asterisks and a space) 
to indicate that the log entry came from an outside source.
Example(s):	atstolog This is a new log comment.
3. Application Programming Interface
3.1. ATSAddEvent
Related EXE:	ATS_EVNT
Description:	Defines an event to ATS.
Syntax:	ATSAddEvent(pEventData, priority);
Parameters:	pEventData:	Pointer to a pATS_EVENT_DATA 	structure.
	priority:	Reseved, set to 0.
Notes:	
3.2. ATSAddHoliday
Related EXE:	ATS_HLDY
Description:	Defines a new holiday to ATS.
Syntax:	ATSAddHoliday(pHolidayData, priority);
Parameters:	pHolidayData:	Pointer to a pATS_HOLIDAY_DATA 		
		strucuture.
	priority:	Reseved, set to 0.
Notes:	
3.3. ATSAddJobQueue
Related EXE:	ATS_JOBQ
Description:	Defines a job queue to ATS.
Syntax:	ATSAddJobQueue(pJobQData, priority);

Parameters:	pJobQData:	Pointer to a pATS_JOBQ_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.4. ATSAddTask
Related EXE:	ATS_TASK
Description:	Definesa task to ATS.
Syntax:	ATSAddTask(pTaskData, priority);
Parameters:	pTaskData:	Pointer to an ATS_TASK_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.5. ATSAddTaskEventLink
Related EXE:	ATS_LINK
Description:	Defines a new link between a defined task and event.
Syntax:	ATSAddTaskEventLink(pLinkData, priority);
Parameters:	pLinkData:	Pointer to an ATS_LINK_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.6. ATSAddToLog
Related EXE:	ATSTOLOG
Description:	Adds a text message to the ATS log. The text string will be 
prefaced with '** ' (two asterisks and a space) to indicate that the 
log entry came from an outside source.

Syntax:	ATSAddToLog(LogText, priority);
Parameters:	LogText:	Pointer to a character string.
	priority:	Reseved, set to 0.
Notes:	
3.7. ATSBlockJobQueue
Related EXE:	ATS_BLKQ
Description:	Blocks or unblocks a job queue.
Syntax:	ATSBlockJobQueue(pJobQData, priority);
Parameters:	pJobQData:	Pointer to an ATS_BLOCK_JOBQ_DATA 	
		structure.
	priority:	Reseved, set to 0.
Notes:	
3.8. ATSFlushQueue
Related EXE:	ATS_FLSH
Description:	Removes all queued tasks from a job queue.
Syntax:	ATSFlushQueue(pFlushQData, priority);
Parameters:	pFlushQData:	Pointer to an ATS_FLUSH_JOBQ_DATA 	
		strucutre.
	priority:	Reseved, set to 0.
Notes:	
3.9. ATSFlushTask
Related EXE:	ATS_FLSH
Description:	Removes a particular task from a job queue.
Syntax:	ATSFlushTask(pFlushQData, priority);
Parameters:	pFlushQData:	Pointer to an ATS_FLUSH_JOBQ_DATA 	
		strucutre.
	priority:	Reseved, set to 0.
Notes:	
3.10. ATSInitJobQueueData
Related EXE:	none
Description:	Initializes, to their default values, all of the fields in the structure 
that is used by ATSAddJobQueue and ATSModifyJobQueue.
Syntax:	ATSInitJobQueueData(pJobQData);
Parameters:	pJobQData:	Pointer to an ATS_JOBQ_DATA structure.
Notes:	
3.11. ATSInitTaskData
Related EXE:	none
Description:	Initializes, to their default values, all of the fields in the structure 
that is used by ATSAddTask and ATSModifyTask.
Syntax:	ATSInitTaskData(pTaskData);
Parameters:	pTaskData:	Pointer to an ATS_TASK_DATA structure.
Notes:	
3.12. ATSIsDateBusinessDay
Related EXE:	ATS_IDBD
Description:	Returns a flag indicating whether or not a particular date is a 
business day based upon defined holidays and weekly business 
days.
Syntax:	ATSIsDateBusinessDay(DateString);
Parameters:	DateString:	Pointer to a string containing a valid date in 
		the format mm/dd/yyyy.
Notes:	If ATS is started with the INTL command line parameter, then ATS 
will accept the DateString parameter for this program if it is in the 
standard format (mm/dd/yyyy) or the international format 
(dd.mm.yyyy).

3.13. ATSModifyJobQueue
Related EXE:	ATS_JOBQ
 Description:	Modifies the definition of a previously defined job queue.
Syntax:	ATSModifyJobQueue(pJobQData, priority);
Parameters:	pJobQData:	Pointer to an ATS_JOBQ_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.14. ATSModifyTask
Related EXE:	ATS_TASK
Description:	Modifies the definition of a previously defined task.
Syntax:	ATSModifyTask(pTaskData, priority);
Parameters:	pTaskData:	Pointer to an ATS_TASK_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.15. ATSQueryActiveTaskCount
Related EXE:	ATS_TCNT
Description:	Returns the number of currently active tasks initiated by ATS.
Syntax:	ATSQueryActiveTaskCount();
Parameters:	none
Notes:	
3.16. ATSRemoveEvent
Related EXE:	ATS_EVNT
Description:Deletes a previously defined event.	
Syntax:	ATSRemoveEvent(EventName, priority);
Parameters:	EventName:	Pointer to a string containing the name of the 
		event to be removed.
	priority:	Reseved, set to 0.
Notes:	
3.17. ATSRemoveHoliday
Related EXE:	ATS_HLDY
Description:	Deletes a previously defined holiday.
Syntax:	ATSRemoveHoliday(pHolidayData, priority);
Parameters:	pHolidayData:	Pointer to an ATS_HOLIDAY_DATA 		
		strucuture.
	priority:	Reseved, set to 0.
Notes:	
3.18. ATSRemoveJobQueue
Related EXE:	ATS_JOBQ
Description:	Deletes a previously defined job queue.
Syntax:	ATSRemoveJobQueue(JobQName, priority);
Parameters:	JobQName:	Pointer to a string containing the name of the 
		job queue to be removed.
	priority:	Reseved, set to 0.
Notes:	
3.19. ATSRemoveTask
Related EXE:	ATS_TASK
Description:	Deletes a previously defined task.
Syntax:	ATSRemoveTask(TaskName, priority);
Parameters:	TaskName:	Pointer to a string containing the name of the 
		task to be removed.
	priority:	Reseved, set to 0.
Notes:	
3.20. ATSRemoveTaskEventLink
Related EXE:	ATS_LINK
Description:	Deletes a previously defined link between a defined task and 
event.
Syntax:	ATSRemoveTaskEventLink(pLinkData, priority);
Parameters:	pLinkData:	Pointer to an ATS_LINK_DATA structure.
	priority:	Reseved, set to 0.
Notes:	
3.21. ATSResetEvent
Related EXE:	ATS_RSET
Description:	Resets an event globally, resets an event for a taskor resets all 
events for a task.
Syntax:	ATSResetEvent(Action, Name1[], Name2[], priority);
Parameters:	Action:	ATS_RESET_TASK, ATS_RESET_EVENT or 
		ATS_RESET_LINK (signal all events for a 	
		task, signal one event for all tasks or signal 
		one event for one task, respectively).
	Name1:	Event name for options ATS_RESET_EVENT 
		and ATS_RESET_LINK, Task name for option 
		ATS_RESET_TASK
	Name2:	Omitted for options ATS_RESET_EVENT and 
		ATS_RESET_TASK, event name for option 
		ATS_RESET_LINK
	priority:	Reseved, set to 0.
Notes:	ATS is case sensitive. If you define an event name in upper, lower, 
or mixed case, you must supply the text in the event name 
parameter in the same case. If you define a task name in upper, 
lower, or mixed case, you must supply the text in the text name 
parameter.
3.22. ATSSignalEvent
Related EXE:	ATS_SGNL
Description:	Signals an event globally, signals an event for a task or signals all 
events for a task.
Syntax:	ATSSignalEvent(Action, Name1[], Name2[], priority);
Parameters:	Action:	ATS_SIGNAL_TASK, ATS_SIGNAL_EVENT 
		or ATS_SIGNAL_LINK (signal all events for a 
		task, signal one event for all tasks or signal 
		one event for one task, respectively).
	Name1:	Event name for options ATS_SIGNAL_EVENT 
		and ATS_SIGNAL_LINK, Task name for option 
		ATS_SIGNAL_TASK
	Name2:	Omitted for options ATS_SIGNAL_EVENT and 
		ATS_SIGNAL_TASK, event name for option 
		ATS_SIGNAL_LINK
	priority:	Reseved, set to 0.
Notes:	
3.23. ATSStop
Related EXE:	ATSSTOP
Description:	Causes an orderly shut down of ATS.
Syntax:	ATSStop(priority);
Parameters:	priority:	Reseved, set to 0.
Notes:	
3.24. PrintATSAPIErrMsg
Related EXE:	ATS_TASK
Description:	Modifies the definition of a previously defined task.
Syntax:	PrintATSAPIErrMsg(rc);
Parameters:	rc:	Return code from one of the other ATS API's.
Notes:	This function will take the return code from one of the other ATS 
API's and display a text string describing the error.




This page intentionally left blank.
4. ATS API Structures
Note: All character string (CHAR) fields are must be null terminated.
4.1. ATS_BLOCK_JOBQ_DATA

typedef	struct	{
		CHAR	QName[13];
		BYTE	BlockState;
		} ATS_BLOCK_JOBQ_DATA, *pATS_BLOCK_JOBQ_DATA;

QName:	The name of the job queue that you want to block or un-
block.
BlockState:	True (if you want to block the job queue) or False (if you 
want to un-block the job queue).

4.2. ATS_EVENT_DATA

typedef	struct	{
		CHAR	EventName[13];
		CHAR	Description[100];
		BYTE	EventType;
		BOOL	ResetOnRun;
		union	{
			ATS_JOB_EVENT_DATA		JobTerm;
			ATS_PERIODIC_EVENT_DATA	Periodic;
			ATS_FILE_EVENT_DATA		File;
			} Detail;
		} ATS_EVENT_DATA, *pATS_EVENT_DATA;

EventName:	The name of the event that you are defining or removing. If 
you are removing the event, none of the other fields are 
required.
Description:	A description of the event.
EventType:	The type of event that you are defining. This can be: J, F, 
S, P or M for Job Termination, File Modification, Signal, 
Periodic and File Missing, respectively.
ResetOnRun:	True (if the event should be reset when the task is run) or 
False (if the event should not be reset when the task is 
run).
Detail:	A union whose appropriate member is used to further 
define the event.
JobTerm:	An occurance of the ATS_JOB_EVENT_DATA structure. 
This structure is used when defining a Job Termination 
event.
Periodic:	An occurance of the ATS_PERIODIC_EVENT_DATA 
structure. This structure is used when defining a Periodic 
event.
File:	An occurance of the ATS_FILE_EVENT_DATA structure. 
This structure is used when defining a File Modification or 
File Missing event.

4.3. ATS_FILE_EVENT_DATA

typedef	struct	{
		CHAR	FileName[CCHMAXPATH];
		BYTE	ChangeCriteria;
		SHORT	AvailabilityOptions;
		} ATS_FILE_EVENT_DATA;

FileName:	The name of the file that this event is based upon. This 
field is used for both File Modification and File Missing 
events. CCHMAXPATH is defined in the OS/2 toolkit 
header file to be 256.
ChangeCriteria:	One of the values in the Change Criteria section of the 
ATSDLL.H file. This field is not used for the File Missing 
event. The possible values are: 
ATS_FILE_EVENT_DATE, ATS_FILE_EVENT_TIME, 
ATS_FILE_EVENT_SIZE, ATS_FILE_EVENT_RO, 
ATS_FILE_EVENT_HIDDEN, 
ATS_FILE_EVENT_SYSTEM or 
ATS_FILE_EVENT_ARCHIVED.
AvailabilityOptions:	One of the values in the Availability Options section of the 
ATSDLL.H file. This field is not used for the File Missing 
event. The possible values are: ATS_OPEN_FOR_READ, 
ATS_OPEN_FOR_WRITE, ATS_DONT_OPEN or 
ATS_OPEN_FOR_READ_AND_WRITE.

4.4. ATS_FLUSH_JOBQ_DATA

typedef	struct	{
		CHAR	QName[13];
		CHAR	TaskName[13];
		} ATS_FLUSH_JOBQ_DATA, *pATS_FLUSH_JOBQ_DATA;

QName:	The name of the job queue that you are removing tasks 
from.
TaskName:	The name of the task to remove from the specified task. If 
the task field is null, all tasks will be removed from the 
specified job queue.

4.5. ATS_HOLIDAY_DATA

typedef	struct	{
		CHAR	HolidayDate[11];
		BYTE	Format;
		CHAR	Description[32];
		} ATS_HOLIDAY_DATA, *pATS_HOLIDAY_DATA;

HolidayDate:	The dateof the holiday that you are adding or removing. If 
you are removing a holiday, none of the other fields are 
required.
Format:	This field is not used yet.
Description:	A description of the holiday.
Notes:	If ATS is started with the INTL command line parameter, 
then ATS will accept the HolidayDate field in this structure 
if it is in the standard format (mm/dd/yyyy) or the 
international format (dd.mm.yyyy).

4.6. ATS_JOBQ_DATA

typedef	struct	{
		CHAR	QName[13];
		CHAR	Description[100];
		BOOL	QBlocked;
		long	Initiators;
		CHAR	StartDate[11];
		CHAR	EndDate[11];
		CHAR	StartTime[9];
		CHAR	EndTime[9];
		BYTE	PriorityGroup;
		long	PriorityDelta;
		WHEN_TO_RUN	WhenToRun;
		struct	{
			BOOL	pPC;
			BOOL	pPD;
			BOOL	pB;
			BOOL	pMC;
			BOOL	pD1;
			BOOL	pD2;
			BOOL	pT1;
			BOOL	pT2;
			BOOL	pD;
			BOOL	pMO;
			BOOL	pDW;
			BOOL	pDM;
			BOOL	pSD;
			} UpdateFields;
		} ATS_JOBQ_DATA, *pATS_JOBQ_DATA;

QName:	The name of the job queue that you are adding, modifying 
or removing. If you are removing the job queue, none of 
the other fields are required.
Description:	A description of the job queue.
QBlocked:	True (if you want the job queue blocked) or False (if you 
want the job queue un-blocked).
Initiators:	The maximum number of cuncurrently active tasks that can 
be started by this job queue.
StartDate:	Valid date in the format: mm/dd/yyyy.
EndDate:	Valid date in the format: mm/dd/yyyy.
StartTime:	Valid time in the format: hh:mm:ss.
EndTime:	Valid time in the format: hh:mm:ss.
PriorityGroup:	The OS/2 priority that the tasks running in this job queue 
will be set to. This can be: I, R, S, C or T for Idle Time, 
Regular, Server, Time Critical or Task. If the priority group 
for the job queue is set to task, then the task priority will 
not be altered when it is started.
PriorityDelta:	An integer between -31 and +31.
WhenToRun:	An occurance of the WHEN_TO_RUN structure which 
defines when the job queue is open (available).

Note:	The following fields are used by ATS to determine which fields to take 
from the input structure and which ones to ignore. When adding a new job 
queue, any field not specified to be taken from the structure will take on its 
default value. When modifying a job queue definition, any field not 
specified to be taken from the structure will remain unchanged.

pPC:	PriorityClass
pPD:	PriorityDelta
pB:	QBlocked
pMC:	Initiators
pD1:	StartDate
pD2:	EndDate
pT1:	StartTime
pT2:	EndTime
pD:	Description
pMO:	WhenToRun.Months
pDW:	WhenToRun.SDW
pDM:	WhenToRun.DOM
pSD:	WhenToRun.SDOM

Notes:	If ATS is started with the INTL command line parameter, 
then ATS will accept the StartDate and EndDate fields in 
this structure if it is in the standard format (mm/dd/yyyy) or 
the international format (dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, 
then ATS will accept the StartTime and EndTime fields in 
this structure if it is in the standard format (hh:mm:ss) or 
the international format (hh.mm.ss).

4.7. ATS_JOB_EVENT_DATA

typedef	struct	{
		CHAR	TaskName[13];
		long	MinRC;
		long	MaxRC;
		} ATS_JOB_EVENT_DATA;

TaskName:	The name of the task that this event is dependent upon.
MinRc:	The minimum return code that is acceptable to set the 
event.
MaxRC:	The maximum return code that is acceptable to set the 
event.

4.8. ATS_LINK_DATA

typedef	struct	{
		CHAR	TaskName[13];
		CHAR	EventName[13];
		} ATS_LINK_DATA, *pATS_LINK_DATA;

TaskName:	The name of the task from/to which your are adding or 
removing an event dependency.
EventName:	The name of the event that you are adding or removing, as 
a dependency, to/from the specifed task.

4.9. ATS_PERIODIC_EVENT_DATA

typedef	struct	{
		CHAR	BaseDate[11];
		CHAR	BaseTime[9];
		long	Interval;
		BYTE	IntervalType;
		} ATS_PERIODIC_EVENT_DATA;

BaseDate:	Valid date in the format: mm/dd/yyyy.
BaseTime:	Valid time in the format: hh:mm:ss.
Interval:	An integer between 0 and 999.
IntervalType:	One of the values in the Periodic Event Intervals section of 
the ATSDLL.H file. The possible values are: S, M, H, D or 
W. They stand for: Seconds, Minutes, Hours, Days and 
Weeks, respectively.
Notes:	If ATS is started with the INTL command line parameter, 
then ATS will accept the BaseDate field in this structure if 
it is in the standard format (mm/dd/yyyy) or the 
international format (dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, 
then ATS will accept the BaseTime field in this structure if 
it is in the standard format (hh:mm:ss) or the international 
format (hh.mm.ss).

4.10. ATS_TASK_DATA

typedef	struct	{
		CHAR	TaskName[13];
		CHAR	Description[100];
		long	MaxConcurOccur;
		CHAR	StartDate[11];
		CHAR	EndDate[11];
		CHAR	StartTime[9];
		CHAR	EndTime[9];
		CHAR	PgmName[CCHMAXPATH];
		CHAR	PgmParms[CCHMAXPATH];
		CHAR	PgmWrkDir[CCHMAXPATH];
		BYTE	SingleRecurring;
		long	MaxOnQCnt;
		char	SessionType;
		CHAR	QName[13];
		long	PriorityInQ;
		WHEN_TO_RUN	WhenToRun;
		BOOL	Independent;
		BOOL	CommandFile;
		BOOL	Background;
		CHAR	EventName[5][13];
		struct	{
			BOOL	pPN;
			BOOL	pP;
			BOOL	pW;
			BOOL	pSR;
			BOOL	pMC;
			BOOL	pOQ;
			BOOL	pD1;
			BOOL	pD2;
			BOOL	pT1;
			BOOL	pT2;
			BOOL	pS;
			BOOL	pQ;
			BOOL	pQP;
			BOOL	pD;
			BOOL	pMO;
			BOOL	pDW;
			BOOL	pDM;
			BOOL	pSD;
			BOOL	pI;
			BOOL	pC;
			BOOL	pB;
			BOOL	pE1;
			BOOL	pE2;
			BOOL	pE3;
			BOOL	pE4;
			BOOL	pE5;
			} UpdateFields;
		} ATS_TASK_DATA, *pATS_TASK_DATA;

TaskName:	The name of the task that you are adding, modifying or 
removing. If you are removing the task, none of the other 
fields are required.
Description:	A description of the task.
MaxConcurOccur:	The maximum number of active cuncurrences of this task.
StartDate:	Valid date in the format: mm/dd/yyyy.
EndDate:	Valid date in the format: mm/dd/yyyy.
StartTime:	Valid time in the format: hh:mm:ss.
EndTime:	Valid time in the format: hh:mm:ss.
PgmName:	The fuly qualified name of the program to start when the 
task is initiated. CCHMAXPATH is defined in the OS/2 
toolkit header file to be 256.
PgmParms:	A string containing the parameters to pass as input to the 
program when starting it. CCHMAXPATH is defined in the 
OS/2 toolkit header file to be 256.
PgmWrkDir:	The directory to be used as the working directory for the 
started program. CCHMAXPATH is defined in the OS/2 
toolkit header file to be 256.
SingleRecurring:	'S' (if you want the task removed from the schedule after it 
is started) or 'R' (if you want it to remain in the schedule).
MaxOnQCnt:	This field is not used yet.
SessionType:	The type of session that the program is to run in. This can 
be: F, W, P, D, d, X, x or - (hyphen) for OS/2 Full screen, 
OS/2 Windowed, Presentation Manager, DOS full screen, 
DOS windowed, Win-OS/2 private, Win-OS/2 common and 
Default. If the value of this field is - (hyphen), the program 
will be run in the default session type for that program.
QName:	The name of the assigned job queue that this program will 
run in.
PriorityInQ:	The priority with in the job queue that this task has.
WhenToRun:	An occurance of the WHEN_TO_RUN structure which 
defines when the task can be started.
Independent:	True (if the task should be started as an independent 
session) or False (if it should be achild of ATS).
CommandFile:	True (if the program that is to be started is a REXX or 
OS/2 Command File) or False (if not).
Background:	True (if ATS shouldnot attempt to give focus to the task 
when starting it) or False (if ATS should attempt to give 
focus to it).
EventName:	An array of 5 character strings. Each string holds the 
name of an already defined event that is to be added to 
the task as a dependency.

Note:	The following fields are used by ATS to determine which fields to take 
from the input structure and which ones to ignore. When adding a new 
task, any field not specified to be taken from the structure will take on its 
default value. When modifying a task definition, any field not specified to 
be taken from the structure will remain unchanged.

pPN:	PgmName
pP:	PgmParms
pW:	PgmWrkDir
pSR:	SingleRecurring
pMC:	MaxConcurOccur
pOQ:	MaxOnQCnt
pD1:	StartDate
pD2:	EndDate
pT1:	StartTime
pT2:	EndTime
pS:	SessionType
pQ:	QName
pQP:	PriorityInQ
pD:	Description
pMO:	WhenToRun.Months
pDW:	WhenToRun.SDW
pDM:	WhenToRun.DOM
pSD:	WhenToRun.SDOM
pI:	Independent
pC:	CommandFile
pB:	Background
pE1:	EventName[0]
pE2:	EventName[1]
pE3:	EventName[2]
pE4:	EventName[3]
pE5:	EventName[4]
Notes:	If ATS is started with the INTL command line parameter, 
then ATS will accept the StartDate and EndDate fields in 
this structure if it is in the standard format (mm/dd/yyyy) or 
the international format (dd.mm.yyyy).
	If ATS is started with the INTL command line parameter, 
then ATS will accept the StartTime and EndTime fields in 
this structure if it is in the standard format (hh:mm:ss) or 
the international format (hh.mm.ss).

4.11. WHEN_TO_RUN

typedef	struct	{
		CHAR	Months[37];
		CHAR	DOW[8];
		CHAR	DOM[32];
		CHAR	SDOM[6];
		int	SDOMDate;
		} WHEN_TO_RUN, *pWHEN_TO_RUN;

Months:	The string ALL for all months or any combination of the 
strings: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, 
SEP, OCT, NOV, DEC concatenated together.
DOW:	A seven character string. Each position represents a day 
of the week. The first position is Sunday and the last is 
Saturday. Each position can be either R, D, H or N for: 
Run, Don't run, run if it is a Holiday and run if it is Not a 
holiday, respectively.
DOM:	A thirty one character string. Each position represents a 
day of the month. The first position is the first of the month 
and the last position is the 31st of the month. All 31 
characters must be supplied regardless of the actual 
number of days in a month. Each position can be either R, 
D, H or N for: Run, Don't run, run if it is a Holiday and run 
if it is Not a holiday, respectively.
SDOM:	A five character string. Each position represents an ATS 
special day. The first position is the last day fo the month, 
the second position is the first business day of the month, 
the third position is the last business day of the month, the 
fourth position is the last business day before the fifteenth 
of the month and the last position is the first business day 
after the fifteenth of the month. Each position can be either 
R or D for: Run and Don't run, respectively.In addition, the 
first position can also be either H or N for: run if it is a 
Holiday and run if it is Not a holiday, respectively.
SDOMDate:	This field is not used yet.






This page intentionally left blank.
5. API to External Interface Cross Reference
Executable	API		Function					
ATS_BLKQ	ATSBlockJobQueue	Blocks or unblocks a job queue.
ATS_EVNT	ATSAddEvent	Defines an event to ATS.
	ATSRemoveEvent	Deletes a previously defined event.
ATS_FLSH	ATSFlushQueue	Removes all queued tasks from a job queue.
	ATSFlushTask	Removes a particular task from a job queue.
ATS_HLDY	ATSAddHoliday	Defines a new holiday to ATS.
	ATSRemoveHoliday	Deletes a previously defined holiday.
ATS_IDBD	ATSIsDateBusinessDay	Returns a flag indicating whether or not a 
particular date is a business day based upon 
defined holidays and weekly business days.
ATS_JOBQ	ATSAddJobQueue	Defines a job queue to ATS.
	ATSRemoveJobQueue	Deletes a previously defined job queue.
	ATSModifyJobQueue	Modifies the definition of a previously defined 
job queue.
ATS_LINK	ATSAddTaskEventLink	Defines a new link between a defined task and 
event.
	ATSRemoveTaskEventLink	Deletes a previously defined link between a 
defined task and event.
ATS_RSET	ATSResetEvent	Resets an event globally, resets an event for a 
task	or resets all events for a task.
ATS_SGNL	ATSSignalEvent	Signals an event globally, signals an event for 
a task or signals all events for a task.
ATS_TASK	ATSAddTask	Defines a task to ATS.
	ATSRemoveTask	Deletes a previously defined task.
	ATSModifyTask	Modifies the definition of a previously defined 
task.
ATS_TCNT	ATSQueryActiveTaskCount	Returns the number of currently active tasks 
initiated by ATS.
ATSMIG	N/A	Migrates the ATS Version 2 data file 
(ATS.DAT) to be compatible with ATS Version 
3.
ATSREORG	N/A	Removes any free space from the ATS data 
file (ATS.DAT).
ATSSTOP	ATSStop	Causes an orderly shut down of ATS.
ATSTOLOG	ATSAddToLog	Adds a text message to the ATS log. The 
message is prefaced with a double asterisk "**" 
to indicate that it came from the API.
N/A	ATSInitJobQueueData	Initializes, to their default values, all of the 
fields in the structure that is used by 
ATSAddJobQueue and ATSModifyJobQueue.
N/A	ATSInitTaskData	Initializes, to their default values, all of the 
fields in the structure that is used by 
ATSAddTask and ATSModifyTask.
6. Samples
6.1. ATS_SGNL.C

#pragma strings(readonly)

#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "atsdll.h"

int main(int, char *[]);

int main(int argc, char *argv[]) {

	LONG		rc;
	char		ErrMsg[30];
	struct RESETDATA { 
				SHORT	Action;
				CHAR		Name1[13];
				CHAR		Name2[13];
				} ResetData;

	printf ("\nATS_SGNL - Copyright MHR Software And Consulting, 1993, 	
		1994\n");
	if (argc < 2) rc = ATS_ERR_ACTION_CODE_MISSING;
	else {
		if (argv[1][0] > 96) argv[1][0] -= 32;
		if (argv[1][0] == 'T') ResetData.Action = ATS_SIGNAL_TASK;
		else if (argv[1][0] == 'E') ResetData.Action = ATS_SIGNAL_EVENT;
		else if (argv[1][0] == 'B') ResetData.Action = ATS_SIGNAL_LINK;
		else rc = ATS_ERR_INVALID_ACTION_CODE;
		}
	if (!rc) {
		switch(ResetData.Action) {
			case ATS_SIGNAL_TASK:
				if (argc < 3) rc = ATS_ERR_TASK_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
					rc = ATS_ERR_TASK_NAME_TOO_LONG;
				break;
			case ATS_SIGNAL_EVENT:
				if (argc < 3) rc = ATS_ERR_EVENT_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
				rc = ATS_ERR_EVENT_NAME_TOO_LONG;
				break;
			case ATS_SIGNAL_LINK:
				if (argc < 3) rc = ATS_ERR_TASK_NAME_MISSING;
				else if (argc < 4)
					rc = ATS_ERR_EVENT_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
					rc = ATS_ERR_TASK_NAME_TOO_LONG;
				else if (strlen(argv[3]) > 12)
					rc = ATS_ERR_EVENT_NAME_TOO_LONG;
				break;
			}
		}
	if (!rc) {
		strcpy(ResetData.Name1, argv[2]);
		if (ResetData.Action == ATS_SIGNAL_LINK)
			strcpy(ResetData.Name2, 	argv[3]);
		else strcpy(ResetData.Name2, "");
		rc = 	ATSSignalEvent(ResetData.Action, ResetData.Name1,
						ResetData.Name2, 0);
		}
	if (rc) PrintATSAPIErrMsg(rc);
	printf("ATSSignalEvent RC: %ld\n", rc);
	return (rc);
	}



6.2. ATS_SGNL.MAK

.SUFFIXES: .c

ATS_SGNL.EXE: ATS_SGNL.OBJ ATS_SGNL.MAK
@REM @<<ATS_SGNL.@0
	/L /E /PACKC /PACKD /RU /NOI /W /ST:32768 /PM:VIO /ALIGN:16 	
	/BASE:65536 $(DEBUGL) +
	ATS_SGNL.OBJ 
	ATS_SGNL.EXE
	ATS_SGNL.MAP
	ATSDLL.LIB

<<
LINK386.EXE @ATS_SGNL.@0
ICC /Tl-

{.}.c.obj:
ICC.EXE \
	/V"ATS Version 3.0, Copyright MHR Software And Consulting, 1993, 1994. 
		All Rights Reserved." \
	/Fi /Q /Si /Ss /G4 /Gm /Gd- /Gt /Ms /I..\ /Wall-ppt-uni-cnd-ini-por $(DEMO) \
	$(DEBUGC) $(DEBUG) /C .\$*.c

!include ATS_SGNL.DEP

6.3. ATS_SGNL.DEP

ATS_SGNL.OBJ:	ATS_SGNL.C	ATS_SGNL.MAK	{..\}ATSDLL.H


6.4. ATS_RSET.C
#pragma strings(readonly)

#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "atsdll.h"

int main(int, char *[]);

int main(int argc, char *argv[]) {

	LONG		rc = 0;
	char		ErrMsg[30];
	struct RESETDATA { 
				SHORT 	Action;
				CHAR		Name1[13];
				CHAR		Name2[13];
				} ResetData;

	printf ("\nATS_RSET - Copyright MHR Software And Consulting, 1993, 	
		1994\n");
	if (argc < 2) rc = ATS_ERR_ACTION_CODE_MISSING;
	else {
		if (argv[1][0] > 96) argv[1][0] -= 32;
		if (argv[1][0] == 'T') ResetData.Action = ATS_RESET_TASK;
		else if (argv[1][0] == 'E') ResetData.Action = ATS_RESET_EVENT;
		else if (argv[1][0] == 'B') ResetData.Action = ATS_RESET_LINK;
		else rc = ATS_ERR_INVALID_ACTION_CODE;
		}
	if (!rc) {
		switch(ResetData.Action) {
			case ATS_RESET_TASK:
				if (argc < 3) rc = ATS_ERR_TASK_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
					rc = ATS_ERR_TASK_NAME_TOO_LONG;
				break;
			case ATS_RESET_EVENT:
				if (argc < 3) rc = ATS_ERR_EVENT_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
					rc = ATS_ERR_EVENT_NAME_TOO_LONG;
				break;
			case ATS_RESET_LINK:
				if (argc < 3) rc = ATS_ERR_TASK_NAME_MISSING;
				else if (argc < 4)
					rc = ATS_ERR_EVENT_NAME_MISSING;
				else if (strlen(argv[2]) > 12)
					rc = ATS_ERR_TASK_NAME_TOO_LONG;
				else if (strlen(argv[3]) > 12)
					rc = ATS_ERR_EVENT_NAME_TOO_LONG;
				break;
			}
		}
	if (!rc) {
		strcpy(ResetData.Name1, argv[2]);
		if (ResetData.Action == ATS_RESET_LINK)
			strcpy(ResetData.Name2, argv[3]);
		else strcpy(ResetData.Name2, "");
		rc = ATSResetEvent(ResetData.Action, ResetData.Name1,
						ResetData.Name2, 0);
		}
	if (rc) PrintATSAPIErrMsg(rc);
	printf("ATSResetEvent RC: %ld\n", rc);
	return (rc);
	}


6.5. ATS_RSET.MAK

.SUFFIXES: .c

ATS_RSET.EXE: ATS_RSET.OBJ ATS_RSET.MAK
@REM @<<ATS_RSET.@0
	/L /E /PACKC /PACKD /RU /NOI /W /ST:32768 /PM:VIO /ALIGN:16 
	/BASE:65536 $(DEBUGL) +
	 ATS_RSET.OBJ 
	ATS_RSET.EXE
	ATS_RSET.MAP
	ATSDLL.LIB

<<
LINK386.EXE @ATS_RSET.@0
ICC /Tl-

{.}.c.obj:
ICC.EXE \
	/V"ATS Version 3.0, Copyright MHR Software And Consulting, 1993, 1994. 
		All Rights Reserved." \
	/Fi /Q /Si /Ss /G4 /Gm /Gd- /Gt /Ms /I..\ /Wall-ppt-uni-cnd-ini-por $(DEMO) \
	$(DEBUGC) $(DEBUG) /C .\$*.c

!include ATS_RSET.DEP

6.6. ATS_RSET.DEP

ATS_RSET.OBJ:	ATS_RSET.C	ATS_RSET.MAK	{..\}ATSDLL.H


6.7. ATSCALL.CBL

IDENTIFICATION DIVISION.
PROGRAM-ID. 'atscall'.
AUTHOR. X.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
CALL-CONVENTION 0 IS MICROSOFT-C.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01	call-struc.
	03	holiday-date.
	05	holiday-mmpic 99 value 06.
		05	holiday-s1pic xvalue '/'.
		05	holiday-ddpic 99 value 23.
		05	holiday-s2pic xvalue '/'.
		05	holiday-ccpic 99 value 19.
		05	holiday-yypic 99 value 93.
	03	date-type pic x value 'u'.
	03	date-desc pic x(32) value
		'test holiday date'.

01result-code pic s9(8) comp-5 value zero.

01dsp-resultpic ---,---,--9.

PROCEDURE DIVISION.
PROG-START.
move 'u' to date-type.
Call 'ATSAddHoliday' using by reference call-struc
			by value 0 size 2
			giving result-code.
move result-code to dsp-result.
DISPLAY 'result = ' dsp-result.
PROG-CONT.
GOBACK.




This page intentionally left blank.

















 
Software And Consulting
ATS for OS/2	Version 3
 

Getting Started	Overview
 

 
Page iv

 
	Page iii










