Automic Workload Automation

  • 1.  ACTIVATE_UC_OBJECT to run a job next day

    Broadcom Employee
    Posted Oct 26, 2018 02:14 AM

    Hello,

     

    I have a scenario:

     

    There are two jobs-  Job1 performs some task when it was executed and it should activate the Job2 for next day.

     

    Below is the script for Job1:

    Pre-Process: 

       :SET &GBDATE# = ADD_DAYS('&$PHYS_DATE_YYYYMMDD#',1)

    Process tab:

       :SET &runnr# = ACTIVATE_UC_OBJECT(MY_JOB2,,&GBDATE#)

     

    When I execute the Job1, it immediately starts the Job2, but when I print &GBDATE# it is showing the next day in Job1 report.

     

    How can I activate the Job2 for next from Job1?  

     

    Thanks,

    Venugopal reddy



  • 2.  Re: ACTIVATE_UC_OBJECT to run a job next day

    Broadcom Employee
    Posted Oct 26, 2018 06:32 AM

    Set the start time value in the 5th placeholder rather than the 3rd.

    eg

    :SET &runnr# = ACTIVATE_UC_OBJECT(MY_JOB2,,,,"YYYY-MM-DD HH:MM:SS")



  • 3.  Re: ACTIVATE_UC_OBJECT to run a job next day

    Broadcom Employee
    Posted Oct 26, 2018 06:44 AM

    Thanks, I tried it and working fine.

    I am new to script and the to calculate next day 9AM as start time I used:

    :SET &GBDATE# = ADD_DAYS('&$PHYS_DATE_YYYYMMDD#',1)
    :SET &SYEAR# = STR_CUT(&GBDATE#, 1, 4)
    :SET &SMONTH# = STR_CUT(&GBDATE#, 5, 2)
    :SET &SDAY# = STR_CUT(&GBDATE#, 7, 2)
    :SET &STIME# = "&SYEAR#-&SMONTH#-&SDAY# 09:00:00"
    :SET &RR# = ACTIVATE_UC_OBJECT('JOBS.WIN.PING_POST',,,,&STIME#)

     

    is there a simpler way?

     

    Thanks,

    Venugopal Reddy



  • 4.  Re: ACTIVATE_UC_OBJECT to run a job next day
    Best Answer

    Broadcom Employee
    Posted Oct 26, 2018 09:47 PM

    As the variable &$PHYS_DATE_DATEFORMAT# has some limitations for available formats I'd use the function and not the variable for physical date.  You just then need to include the date format in your add_days function.

    eg

    :SET &DATE# = SYS_DATE_PHYSICAL('YYYY-MM-DD')
    :SET &EXEDATE# = ADD_DAYS("YYYY-MM-DD:&DATE#",1)
    :SET &EXETIME# = "09:00:00"
    :SET &RR# = ACTIVATE_UC_OBJECT('JOBS.WIN.PING_POST',,,,"&EXEDATE# &EXETIME#")



  • 5.  Re: ACTIVATE_UC_OBJECT to run a job next day

    Broadcom Employee
    Posted Oct 26, 2018 10:28 PM

    Thanks again.