Automic Workload Automation

  • 1.  Get email before and after a job start

    Posted Jul 20, 2017 12:04 AM
    Your Question
    I would like to know, how to retrieve batch's start time, end time and runtime in an email. I tried adding predefined variables in pre-process and post-process tab of job. But that doesn't work. It popped out like "OPERATOR can only be allowed in NOTIFICATION object". 

    Requirement: When a job start from Uc4, an email should be sent embedding its BATCH_NAME, START_TIME along with DATE. Likewise, when a job ends, an email should be sent with mail body having BATCH_NAME, START_TIME, END_TIME and RUNTIME along with DATE. Mail Subject - BATCH STATUS.

    Our Answer
    You can create a NOTIFICATION Object and activate it in Pre-process and Post-procest tab by ACTIVATE_UC_OBJECT function:

    :SET &ACTOBJ# = ACTIVATE_UC_OBJECT("your notification object name",,,,,PASS_VALUES)

    pu7r24n9qqxm.jpghttps://us.v-cdn.net/5019921/uploads/editor/28/pu7r24n9qqxm.jpg" width="722">
    FYI: 
    If you want to send email from AE system, you need to configure the UC_CLIENT_SETTING, please check the reference links for more detail.

    Reference links:
    https://docs.automic.com/documentation/webhelp/english/AWA/12.0/DOCU/12.0/AWA%20Guides/help.htm#AWA/Objects/obj_notifications.htm%3FTocPath%3DUser%2520Guide%7CProcess%2520Assembly%2520Perspective%7CDefining%2520Objects%7CNotification%7C_____0
    https://docs.automic.com/documentation/webhelp/english/AWA/12.0/DOCU/12.0/AWA%20Guides/help.htm#AWA/Admin/admin_UC_CLIENT_SETTINGS.htm
    https://docs.automic.com/documentation/webhelp/english/AWA/12.0/DOCU/12.0/AWA%20Guides/help.htm#AE_AWA_Source/Script/ucaafh.htm%3FTocPath%3DAutomic%2520Scripting%2520Guide%7COrdered%2520by%2520Function%7CActivate%2520Objects%7C_____5


  • 2.  Get email before and after a job start

    Posted Jul 20, 2017 12:17 AM
    Hi Dat,

    without modifying too many job objects you can also use the mechanism provided by HEADER.<platform>.USER.PRE and TRAILER.<platform>.USER.END/TRAILER.<platform>.USER.ABEND


  • 3.  Get email before and after a job start

    Posted Jul 20, 2017 03:12 AM
    Hi Dat,

    Can you please clarify, what should be included in ":SET &ACTOBJ# = ACTIVATE_UC_OBJECT("your notification object name"<here?>,,,,,PASS_VALUES)".

    Eg. If my mail body should contain- "BATCH '<batch name>' started in DEV environment at 
    07/20/2017 13:54:48".  I can use 
    :set &date# = SYS_DATE_PHYSICAL()
    :set &time# = SYS_TIME_PHYSICAL("HH:MM:SS")
    to get time and date. But how to get the batch name in my mail. I should not hard code any batch name in my notification object and it should be a generic template to be used in all Jobs such that when I add the function you specified, it should pick up batch name by itself.


  • 4.  Get email before and after a job start

    Posted Jul 20, 2017 03:27 AM
    If you have no Idea how to handle activate_uc_object you can have a look here:

    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All%20Guides/help.htm#ucaafh.htm%3FTocPath%3DAutomation%2520Engine%2520Script%2520Guide%7COrdered%2520by%2520Function%7CActivate%2520Objects%7C_____5

    If you still have no Idea I would recommend attending an Automic Basics Training and an Automic Script training. :-)



  • 5.  Get email before and after a job start

    Posted Jul 20, 2017 04:49 AM
    Hi Wolf,

    Instead of going with above function, I tried with simple SEND_MAIL function.as below:

    :set &date# = SYS_DATE_PHYSICAL()
    :set &time# = SYS_TIME_PHYSICAL("HH:MM:SS")
    :set &date1# = conv_date(&date#,"MM/DD/YYYY")

    :SET &RET# = SEND_MAIL("sudharson.narayanamoorthy@logicinfo.com",,"BATCH_STATUS: DLYPRG - DEV","Batch DLYPRG completed at &date1# &time# with Elapsed Runtime - &$RUNTIME#")

    Everything worked fine except the runtime. 

    It displayed output as "Batch DLYPRG completed at 07/20/2017 15:41:58 with Elapsed Runtime - 0000000000000000"

    Is there any conversion code to convert Run time to human readable Format.

    The link provide below doesn't help me as I got this error while running the job post completion. "Last message     U0020251 Runtime error in object 'DLYPRG(2)', line '00006'. Cannot interpret text: 'GET_STATISIC_DETAIL'. Check syntax."




  • 6.  Get email before and after a job start

    Posted Jul 20, 2017 05:37 AM
    Possibly it works with GET_STATISTIC_DETAIL :-)

    the predefined Script variable &$RUNTIME# does return a valid value in PostScript ONLY!


  • 7.  Get email before and after a job start

    Posted Jul 20, 2017 07:56 AM
    Hi Wolfgang,

    Awesome. It works. 

    Thank You :)




  • 8.  Get email before and after a job start

    Posted Jul 20, 2017 08:21 AM
    You `re welcome :-)