Automic Workload Automation

  • 1.  Report or Script: Last runtime of jobs

    Posted Jul 22, 2015 11:38 AM

    Hi all,

    Does anyone have a script or report that they would be willing to share, for Automic V9 ONE Automation, to pull the job name and last run date?

    I am sure this is something simple, but just pressed for time and wanted to see if someone had something written already.

    Thanks,

    -Eric



  • 2.  Report or Script: Last runtime of jobs

    Posted Jul 22, 2015 01:05 PM
    EricGauthier608693  I would start with something like this;

    Select oh_name, oh_client, oh_lastdate
    from oh
    where oh_otype = 'JOBS'
    and   oh_deleteflag = 0
    and   oh_refidnr = 0
    and oh_client = &$client#
    order by oh_lastdate

    I suspect the date that is returned needs to be adjusted for GMT.


  • 3.  Report or Script: Last runtime of jobs

    Posted Jul 22, 2015 03:15 PM
    You might consider the UCYBDBRT DB Reporting Tool utility. 


  • 4.  Report or Script: Last runtime of jobs

    Posted Jul 23, 2015 06:53 PM

    @Pete Wirfs

    Thanks for the script.  I ran this, and got NULL for all my dates. 



  • 5.  Report or Script: Last runtime of jobs

    Posted Jul 23, 2015 11:31 PM
    Hi Eric
    It is not clear for your Text - what script you need.   If you need to pull the Job name and date directly from within the Job, here is the UC4 Script to do so.  Getting the last run of a Job is not possible from within the Job directly with Script.   You will have to define a Variable object and store the last run time when it is run.
    :set &jobname# = SYS_ACT_JOBNAME() :set &lastrun# = GET_VAR(VARA_JOB_LAST_RUN,&jobname#) :set &today# = SYS_DATE_PHYSICAL('YYYYMMDD')
    :if &lastrun# = &today# !   Don't run job if it was already run today :   STOP NOMSG :else !   Run job and store current run detail in Variable :   set &lastrun# = SYS_DATE('YYYYMMDD') :   put_var VARA_JOB_LAST_RUN, &jobname#, &lastrun# !
    !DATALINES GO HERE ...
    !
    :endif


  • 6.  Report or Script: Last runtime of jobs

    Posted Jul 24, 2015 04:21 AM
    You can use following SQL script:

    select TOP(1) AH_IDNR as "Run ID", AH_TimeStamp2 as "Start Time"  from ah
    where ah_name= 'JOBS.WIN.SCHUBIDUBA'
    and ah_client = 22
    order by ah_timestamp2 DESC


    Timestamp2 is start time of the job (not Generation!)
    As Pete mentioned, this will return UTC time



  • 7.  Report or Script: Last runtime of jobs

    Posted Jul 24, 2015 12:55 PM
    I forgot... The oh_lastdate column only gets populated if you set LAST_USE to "1" within UC_SYSTEM_SETTINGS.  We have this option turned on.  It is a nice convenience, but turning on this feature will cause a little more execution overhead.

    Wolfgang's solution finds what you want via statistics.