Is there a way to thread (queue) Autotask attached to start-up and shutdown?
I am in need to run Autotask in sequential order for a application requirement:
TASK1 - should start and complete first TASK2 - should start and complete after TASK1 completes
We are running IDMS 18.5 and in currently, all the Autotask are dispatched one after another, but TASK2 is starting even before TASK1 could complete.
is it even possible to schedule the auto task one after another? if yes, how can we achieve it?
Startup autotasks are started in the order they are defined in the SYSGEN - but all at the same time and they run simultaneously.We don't wait for one to finish to invoke the next one.You could use DC RETURN with the NEXT TASK CODE option at the end of one program to invoke tasks in serial.https://docops.ca.com/ca-idms-ref/19/en/dml-reference-for-cobol/cobol-data-manipulation-language-dml-statements/dc-return-cobol
If your autotask programs currently (or can be modified to) display a message to the log – you could use wto routine to fire off the next one
Or , writing a msg to the jes log, use an automation product (ops/mvs?) to start the next one
Technology Architect, Database Infrastructure Services
Technology Solution Services
123 East Main Street
Louisville, KY 40202
(502) 476-2538 or 407-7266
You could also use ATTACH or SET TIMER START to start TASK2 from TASK1 when it has done what it needs to do.
Or if TASK2 can somehow check if TASK1 has done it's thing, it could use SET TIMER WAIT to issue waits until it sees that TASK1 has done what is needed for it to run.
I found some old notes from John Siraco (or was it notes from OLD John Siraco):
specifying the "prempt" option for all autotasks which will since thread them.
AUTOTASK Statement Parameters
Indicates the startup autotask will execute to completion before any user tasks are executed
This does not mean the autotasks themselves are single threaded. it means the Autotasks with PREEMPT specified will complete before any normal users tasks can begin.
Ian's method is best and Stephen's suggestions will also work
The manual says that PREEMPT only prevents user tasks from running while the autotask is running. It does not suggest that autotasks are single threaded. If that is incorrect, then perhaps the manual should be updated to indicate that.
Sorry. I spoke to John Siraco and he indicated that if an AUTOTASK definition has PREEMPT, MSTR will not proceed to the next AUTOTASK until the first is complete. If there is only one AUTOTASK, then CV will not be fully up and ready to process user tasks from terminals or ERUS until it completes.
If there are multiple AUTOTASKs all of which specify PREEMPT, they will indeed be single threaded.
In sysgen compiler if you get current on your SYSTEM number and DISPLAY ALL AUTOTASK, the order they display is the order they will be connected to CSA list of Startup Autotasks.
Hope this helps. The other suggestions given would also work.
Nice to know that Brian.
You said "until the first is complete". I assume you mean until the task with PREEMPT is complete. So for example if I have three startup autotasks defined as:
Then at startup TASK1 and TASK2 will both start, but TASK3 will not start until TASK2 is complete, regardless of the status of TASK1, correct? Also no user tasks will run until TASK2 is complete, also regardless of the status of TASK1 & TASK3, right?
Can the documentation be updated to reflect this? It might have saved the OP some headache as well as others.
Stephen, that is indeed how I understand it.
I will ask SE to clarify the documentation.
DocOps has been updated to have this description for AUTOTASK PREEMPT parameter:
Thanks for all your inputs. I am trying out Ian's suggestion. Will let you know how it goes.