IDMS

 View Only
Expand all | Collapse all

Sequencing Autotask

  • 1.  Sequencing Autotask

    Posted Jan 31, 2019 05:12 AM

    Hi,

     

    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?

     

    Thanks,

    Chalcedony



  • 2.  Re: Sequencing Autotask
    Best Answer

    Broadcom Employee
    Posted Jan 31, 2019 05:30 AM

    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



  • 3.  Re: Sequencing Autotask

    Posted Jan 31, 2019 09:28 AM

    Or …..

     

    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

     

     

    Chris Hoelscher

    Technology Architect, Database Infrastructure Services

    Technology Solution Services

    Humana Inc.

    123 East Main Street

    Louisville, KY 40202

    Humana.com

    (502) 476-2538 or 407-7266



  • 4.  Re: Sequencing Autotask

    Posted Jan 31, 2019 09:48 AM

    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.



  • 5.  Re: Sequencing Autotask

    Posted Jan 31, 2019 10:07 AM

    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.

     

    Chris Hoelscher

    Technology Architect, Database Infrastructure Services

    Technology Solution Services

    Humana Inc.

    123 East Main Street

    Louisville, KY 40202

    Humana.com

    (502) 476-2538 or 407-7266



  • 6.  Re: Sequencing Autotask

    Broadcom Employee
    Posted Jan 31, 2019 10:15 AM

    AUTOTASK Statement Parameters 

    PREempt

    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. 



  • 7.  Re: Sequencing Autotask

    Broadcom Employee
    Posted Jan 31, 2019 10:16 AM

    Ian's method is best and Stephen's suggestions will also work



  • 8.  Re: Sequencing Autotask

    Posted Jan 31, 2019 10:17 AM

    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.



  • 9.  Re: Sequencing Autotask

    Broadcom Employee
    Posted Jan 31, 2019 10:59 AM

    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.  



  • 10.  Re: Sequencing Autotask

    Posted Jan 31, 2019 11:18 AM

    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:

    TASK1

    TASK2 PREEMPT

    TASK3

    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.



  • 11.  Re: Sequencing Autotask

    Broadcom Employee
    Posted Jan 31, 2019 11:22 AM

    Stephen,  that is indeed how I understand it.

    I will ask SE to clarify the documentation.



  • 12.  Re: Sequencing Autotask

    Broadcom Employee
    Posted Jan 31, 2019 05:49 PM

    DocOps has been updated to have this description for AUTOTASK  PREEMPT parameter:

     

    • PREempt
      Indicates that the startup autotask executes to completion before user tasks are executed, including subsequent autotasks.


  • 13.  Re: Sequencing Autotask

    Posted Feb 01, 2019 07:55 AM

    Thanks for all your inputs. I am trying out Ian's suggestion. Will let you know how it goes.