Automic Workload Automation

 View Only
  • 1.  Is there a way to get a list of tasks inside a schedule programmatically?

    Posted Oct 10, 2018 06:44 PM

    Is there a way to get a list of tasks inside a schedule programmatically?

     

    Ideally without exporting the object and checking via shell script, or java.  I'm hoping a combination of a clever SQL call and a little scripting.

     

    I'm not quite seeing anything in the OSA table that will help, but that seems like where it would be.



  • 2.  Re: Is there a way to get a list of tasks inside a schedule programmatically?
    Best Answer

    Posted Oct 10, 2018 07:05 PM

    Credit to petwir I believe is where I got this from. Here is what I use in our environment quite often (oracle):

     

    select oh_name as SCHEDULE
    , jpp_object as OBJECT
    , JPP_ErlstStTime as STARTTIME
    , jppc_calekeyname as CALENDAR
    from oh
    inner join jpp
    on oh_idnr = jpp_oh_idnr
    left outer join jppc
    on jppc_jpp_lnr = jpp_lnr and jppc_oh_idnr = oh_idnr
    where oh_name = 'JSCH.NAME.HERE'
    order by 1,2,3,4



  • 3.  Re: Is there a way to get a list of tasks inside a schedule programmatically?

    Posted Oct 11, 2018 10:53 AM

    Wow, that's really helpful!  Thanks!

     

    If you don't mind, can I ask you another?  Is there an easy way to pull the turnaround time for a certain schedule?



  • 4.  Re: Is there a way to get a list of tasks inside a schedule programmatically?

    Posted Oct 11, 2018 12:02 PM

    I don't know about "easy".

     

    Now that you have the list of objects that are in your schedule, you could return the min(start time) and max(end time) for a given day from the statistics table for that list of objects.  Those statistics are stored in the AH table.  Column ah_timestamp2 contains the start time, and column ah_timestamp3 contains the end time, both stored in GMT.  The SQL could compute the difference between the min() and max(), thus giving you "turnaround time" for that day.

     

    EDIT:

    MatthiasSchelp has provided the appropriate query for returning the litteral "turnaround time" for a schedule object.   I was thinking your requirement was more like "how long does it take for the objects in the schedule to run".   I suspect Matthias's SQL is what you really want?



  • 5.  Re: Is there a way to get a list of tasks inside a schedule programmatically?

    Posted Oct 11, 2018 12:03 PM

    That's an easy one ...

    select TO_CHAR(OSA_STARTTIME,'HH24:MI:SS') from OSA;


  • 6.  Re: Is there a way to get a list of tasks inside a schedule programmatically?

    Posted Oct 16, 2018 10:32 AM

    Pete: I see what you're thinking.  That would be a good way to look at statistics!

     

    Matthais:  Thanks, that's exactly it!