Automic Workload Automation

Expand all | Collapse all

Retrieving the list of tasks that have been executed

  • 1.  Retrieving the list of tasks that have been executed

    Posted Aug 17, 2016 06:00 AM
      |   view attached
    The activity windows allows you to see active / ended tasks until they have been deactivated.

    1 - Statistical data has not been removed from the database (maintenance has not been performed yet).

    To display tasks that have already been deactivated, you can use the "Periods..." button :
    h71avtkcs4gw.jpg

    Adjust the period...
    otmru82k88sw.jpghttps://us.v-cdn.net/5019921/uploads/editor/ec/otmru82k88sw.jpg" width="451">

    Adjust object types...
    uhgsmn101ajr.jpghttps://us.v-cdn.net/5019921/uploads/editor/nx/uhgsmn101ajr.jpg" width="451">

    ... and Status / RunID, Host, etc.

    The results will displayed in a list like below:
    h95zrgdxk4bh.jpghttps://us.v-cdn.net/5019921/uploads/editor/1c/h95zrgdxk4bh.jpg" width="1192">

    If you hit the limit of records which can be displayed you will get this error message :
    8uhjih2tvfqe.jpg

    This can be increased up to 20000 records: connect to Client 0 and edit the system variable UC_SYSTEM_SETTINGS. Then adjust the value of key 'GENERIC_STATISTICS_LIMIT'.
    5nb1uhsbvn24.jpghttps://us.v-cdn.net/5019921/uploads/editor/zx/5nb1uhsbvn24.jpg" width="646">

    2 - Data has been archived with the DB Archive utility

    You can then use the Archive Browser to consult the data.



  • 2.  Retrieving the list of tasks that have been executed

    Posted Aug 18, 2016 10:35 AM
    While this is very flexible, please be aware the modification(s) to the GENERIC_STATISTICS_LIMIT can have impact on overall performance. This is very quickly magnified in environments where there are a lot of users that do large amount of statistic reviews. 


  • 3.  Retrieving the list of tasks that have been executed

    Posted Aug 18, 2016 10:43 AM
    Thanks Darren for your input.

    That's right... I was also thinking of a SQL statement to retrieve this information.

    I should post it soon but it's still incomplete. It looks like this for now:

    SELECT AH_NAME as 'Name',OH_Otype as 'Type', AH_Idnr as 'RunID', AH_Timestamp1 as 'Activation time', AH_USR_idnr, AH_Timestamp4 as 'End time',
    CASE AH_Status
    WHEN '1300' THEN 'Preparing'
    WHEN '1301' THEN 'Waiting for user-input/a prompt is displayed for the user'
    WHEN '1510' THEN 'Transferred'
    WHEN '1520' THEN 'Ready for transfer (before connect)'
    WHEN '1521' THEN 'Ready to be transferred'
    WHEN '1529' THEN 'Ready for generation'
    WHEN '1530' THEN 'Ready for start'
    WHEN '1531' THEN 'To be called'
    WHEN '1540' THEN 'Start initiated'
    WHEN '1541' THEN 'Checking'
    WHEN '1542' THEN 'Calling'
    WHEN '1543' THEN 'Unknown'
    WHEN '1544' THEN 'Inconsistent'
    WHEN '1545' THEN 'Started'
    WHEN '1546' THEN 'Connecting'
    WHEN '1547' THEN 'Inconsistent RemoteTaskManager'
    WHEN '1550' THEN 'Active'
    WHEN '1551' THEN 'Transferring'
    WHEN '1552' THEN 'Called'
    WHEN '1553' THEN 'Accepted'
    WHEN '1554' THEN 'Sampling Files'
    WHEN '1556' THEN 'Escalated'
    WHEN '1557' THEN 'Custom backup'
    WHEN '1800' then 'ENDED_NOT_OK - Aborted'
    WHEN '1900' then 'ENDED_OK - ended normally'
    END
    FROM AH,OH
    WHERE OH_Idnr=AH_OH_idnr
    AND OH_Otype NOT IN ('SERV','HOST','CLNT', 'QUEUE', 'USER')
    ORDER BY AH_STATUS
    I still need to add all missing return codes. Also, I cannot figure how to convert the AH_USR_Idnr to the actual user name (which is stored in OH table).
    Any ideas ?


  • 4.  Retrieving the list of tasks that have been executed

    Posted Aug 19, 2016 04:08 AM
    Please do not mismatch the Tables :-)

    Activity Window entries are based on the EH (executive Header) but Statistics Window entries have the AH table as source.
    So if you want to query Activities window its not influenced by the archive/reorg/unload runs in your system.

    Here is a short example with a subselect on the AH table:

    select distinct * from AH
    where Ah_client = 1
    and AH_OTYPE in ('JOBS', 'JOBP', 'SCRI')
    and ah_usr_idnr= (select oh_idnr from OH
    where oh_client= 1
    and oh_otype='USER'
    and oh_name = 'BRW/MASTA');

    possibly it would be better using a JOIN


  • 5.  Retrieving the list of tasks that have been executed

    Posted Aug 19, 2016 05:25 AM
    Hi Wolfgang,

    Thanks for your input. The idea is indeed to query the AH table, because from my understanding entries are being removed from EH when deactivating tasks from the activities window. Maybe my description was not so clear, but I do get the difference between AH and EH and the fact that EH is not affected by maintenance.

    What I'm looking for is to display the list of activities in a way that emulates the activity window. I'd like to join AH and OH to display the user name (taken from OH > OH_name) rather than its RunID (which corresponds to AH_USR_Idnr)

    rrwvjh7x08ly.pnghttps://us.v-cdn.net/5019921/uploads/editor/1o/rrwvjh7x08ly.png" width="1049">




  • 6.  Retrieving the list of tasks that have been executed

    Posted Aug 19, 2016 06:14 AM
    what about this one:
    SELECT AH_NAME as 'Name',AH_Otype as 'Type', AH_Idnr as 'RunID', AH_Timestamp1 as 'Activation time', OH_name as 'User', AH_Timestamp4 as 'End time',
    CASE AH_Status
    WHEN '1300' THEN 'Preparing'
    WHEN '1301' THEN 'Waiting for user-input/a prompt is displayed for the user'
    WHEN '1510' THEN 'Transferred'
    WHEN '1520' THEN 'Ready for transfer (before connect)'
    WHEN '1521' THEN 'Ready to be transferred'
    WHEN '1529' THEN 'Ready for generation'
    WHEN '1530' THEN 'Ready for start'
    WHEN '1531' THEN 'To be called'
    WHEN '1540' THEN 'Start initiated'
    WHEN '1541' THEN 'Checking'
    WHEN '1542' THEN 'Calling'
    WHEN '1543' THEN 'Unknown'
    WHEN '1544' THEN 'Inconsistent'
    WHEN '1545' THEN 'Started'
    WHEN '1546' THEN 'Connecting'
    WHEN '1547' THEN 'Inconsistent RemoteTaskManager'
    WHEN '1550' THEN 'Active'
    WHEN '1551' THEN 'Transferring'
    WHEN '1552' THEN 'Called'
    WHEN '1553' THEN 'Accepted'
    WHEN '1554' THEN 'Sampling Files'
    WHEN '1556' THEN 'Escalated'
    WHEN '1557' THEN 'Custom backup'
    WHEN '1800' then 'ENDED_NOT_OK - Aborted'
    WHEN '1900' then 'ENDED_OK - ended normally'
    END as 'Status'
    FROM AH WITH (NOLOCK)
    join OH WITH (NOLOCK)
    on OH_IDNR = AH_usr_idnr
    WHERE AH_Otype NOT IN ('SERV','HOST','CLNT', 'QUEUE', 'USER', 'REPORT')
    and ah_client=1
    ORDER BY AH_STATUS

    Whats still unclear to me: display the list of activities in a way that emulates the activity window.
    Witch statistic data you never ever can emulate activities window ?!?

    This query is still for historical purposes.

    Pls let it check from someone in Support with deep AE Knowledge for consistency.




  • 7.  Retrieving the list of tasks that have been executed

    Posted Aug 19, 2016 06:21 AM
    That's exactly what I was looking for!! Thank you Wolfgang :smiley:


  • 8.  Retrieving the list of tasks that have been executed

    Posted Aug 19, 2016 06:24 AM
    NP you are welcome - as usual :-)


  • 9.  Retrieving the list of tasks that have been executed

    Posted Aug 24, 2016 03:27 AM
    Wolfgangs query delivers a different result set than your query.
    On our Testsystem 1249 Rows vs 42k Rows on one of our Testsystems, so i am not sure if it is what you have been looking for, at least it does notquery what you have queried.

    I created one that matches yours and just adds the username

    SELECT a.AH_NAME as 'Name', a.AH_Idnr as 'RunID', o1.OH_Otype as 'Type', a.AH_Timestamp1 as 'Activation time', a.AH_USR_idnr, o2.oh_name, a.AH_Timestamp4 as 'End time',
    CASE AH_Status
    WHEN '1300' THEN 'Preparing'
    WHEN '1301' THEN 'Waiting for user-input/a prompt is displayed for the user'
    WHEN '1510' THEN 'Transferred'
    WHEN '1520' THEN 'Ready for transfer (before connect)'
    WHEN '1521' THEN 'Ready to be transferred'
    WHEN '1529' THEN 'Ready for generation'
    WHEN '1530' THEN 'Ready for start'
    WHEN '1531' THEN 'To be called'
    WHEN '1540' THEN 'Start initiated'
    WHEN '1541' THEN 'Checking'
    WHEN '1542' THEN 'Calling'
    WHEN '1543' THEN 'Unknown'
    WHEN '1544' THEN 'Inconsistent'
    WHEN '1545' THEN 'Started'
    WHEN '1546' THEN 'Connecting'
    WHEN '1547' THEN 'Inconsistent RemoteTaskManager'
    WHEN '1550' THEN 'Active'
    WHEN '1551' THEN 'Transferring'
    WHEN '1552' THEN 'Called'
    WHEN '1553' THEN 'Accepted'
    WHEN '1554' THEN 'Sampling Files'
    WHEN '1556' THEN 'Escalated'
    WHEN '1557' THEN 'Custom backup'
    WHEN '1800' then 'ENDED_NOT_OK - Aborted'
    WHEN '1900' then 'ENDED_OK - ended normally'
    END
    FROM AH a, oh o1, oh o2
    WHERE
    a.ah_oh_idnr = o1.oh_idnr
    and a.AH_USR_idnr = o2.oh_idnr
    and o1.oh_otype NOT IN ('SERV','HOST','CLNT', 'QUEUE', 'USER')
    ORDER BY AH_STATUS

    I have no idea what this statement shall be used for, but i wanted to show how to get the user name. :-)




  • 10.  Retrieving the list of tasks that have been executed

    Posted Aug 24, 2016 03:40 AM
    Daniel_Trimmel_2011 Danke viel mals :smiley:
    You're right I get the exact same number of results with your query as with my original one.

    Need to practice a bit on these tables alias.

    Thanks again!


  • 11.  Retrieving the list of tasks that have been executed

    Posted Aug 24, 2016 03:56 AM
    THX Daniel for correcting my statement - at the moment I don´t get the mistake I did...


  • 12.  Retrieving the list of tasks that have been executed

    Posted Aug 24, 2016 04:30 AM
    FrankMuffke: I think it's about the joint on the OH field:

    join OH WITH (NOLOCK)
    on OH_IDNR = AH_usr_idnr

    It probably restricts the number of records to those where a user was activated. Not absolutely certain though...