Workload Automation

Expand all | Collapse all

need help in one of the autosys scenarios

Jump to Best Answer
  • 1.  need help in one of the autosys scenarios

    Posted 09-28-2017 05:13 AM

    i have a condition.

     

    job A runs at 1 AM

    job B runs at 8 PM

     

    i want to schedule job C in such a way that it runs after s(job A) and s(job B) (job A and B has succeeded for a day) and then it should trigger job C and job C should run only once a day.

     

    How can i acheive it.



  • 2.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 05:38 AM

    simply define the job c as follows. This will trigger the job c once both A and B job completes successfully.

     

    conditions: s(job A) and s(job B)

     

    Since you haven't specify about the days_of_week / run days, so I am assuming here that both job A and job B will run on same day, so do JOB C.

    However, if all 3 jobs are running on different days, then you may need to refer or use lookback condition.



  • 3.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 05:43 AM

    both a and b runs on the same day but different time.

    so , does the time will not create an issue if i put above condition



  • 4.  Re: need help in one of the autosys scenarios
    Best Answer

    Posted 09-28-2017 05:59 AM

    well it depends on how you are defining / designing these jobs. I mean are you planning to put them in BOX or out of box.

    Hope you are aware of BOX job features and how Box and JObs inside BOX will behave?

     

     

    If in BOX, then you can put the run frequency on BOX.

     

    BOX_ABC -> runs daily at 1AM

    JOB A -> not need to put any schedule and it will run immediately as soon as BOX comes to RUNNING STATE at 1AM

    JOB B -> Here you can put time dependency of 8PM, then the BOX will be in running state till 8PM.

    JOB C -> conditions: s(JOB A) & s(JOB B). Here as soon as JOB B completes(SUCCESS) its 8PM run, JOB c will run.

     

    Here in this scenario, since you have different start times of jobs involved, I would not suggest to go for BOX feature as BOX job has some unique features or behavior which can complicate the situation during abnormal situations(like long running, missing its run window etc) or adhoc runs.

     

    I would go for OUT of BOX concept, where all 3 jobs will run as per there run frequency and float the conditions in the autosys envt to trigger the dependency.

     

    JOB A -> Define to run at 1AM.

    JOB B -> Here you can put time dependency of 8PM.

    JOB C -> conditions: s(JOB A) & s(JOB B). Here as soon as JOB B completes(SUCCESS) its 8PM run, JOB c will run.

     

    Defining these kind of scenarios like this (OUT of box) will ease the operations in abnormal situations(like long running, missing its run window etc) or adhoc runs.

     

    Request you to go through BOX feature / BOX behavior in details before actually using BOX jobs if you are new to AUTOSYS or BOX jobs. UNICENTRE AUTOSYS 4.0 version documentation is best reference to UNDERSTAND in detail on BOX jobs.

     

    Hope it will clarify your question and ease the scheduling SCENARIOS.



  • 5.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 07:21 AM

    Using the out of box solution described here may cause JOB C to run twice per day.

     

    Imagine this scenario:

    • Monday. JOB A runs at 1am, JOB B at 8pm and (assuming both run to SUCCESS) JOB C immediately after JOB B.
    • Tuesday - Now all three jobs are in SU state (having run on Monday). JOB A runs at 1am, completes successfully and satisfies JOB C's starting conditions - JOB C will run. JOB B runs at 8pm, completes successfully and satisfies JOB C's starting conditions - JOB C will run again.

    In addition, if there is a need to manually re-run either JOB A or JOB B out of schedule then the SUCCESS event will also trigger JOB C.

     

    Perhaps consider the below:

    JOB A runs at 1am

    BOX 1 runs at 8pm and contains JOB B and JOB C

       JOB B runs immediately at 8pm

       JOB C contains condition 'success(JOB A) and success{JOB B)'

     

    In this manner, JOB A and JOB B can be run in/out of schedule without triggering JOB C. You may wish to consider setting a box_success value on BOX 1.

     

    There are a number of ways to achieve this type of behaviour within AutoSys. If you have a development or test environment that you can use then I recommend testing each solution and deploying whichever best suits your requirements.



  • 6.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 08:00 AM

    As you pointed out there are a number of ways. You can use a filetrigger in between the jobs A and B if you like or defining a resource to off and switch it to on when ready. You can also let A and B be in the same box, B on hold until a certain time (outside batch releasing it). When B finishes C can start with the same box as A and B just waiting for A and B or outside, using a resource or trigger.



  • 7.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 05:50 AM

    instead cannot we put below condition: -

    conditions: s(job A,0) and s(job B,0)



  • 8.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 06:39 AM

    Well, you are referring to LOOKBACK and usage of LOOKBACK attribute has to be dealt cautiously and if and only if when you are certain and predictable about your application team's requirement / flow behavior and most importantly when you know how to use lookback, when to use and where to use lookback, otherwise it will lead to great mess and confusion.

     

    if u have TEST envt to test the LOOKBACK, exploit that envt to the fullest before deploying it to PRODUCTION.



  • 9.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 07:12 AM

    Either keep both the jobs inside a box or you can use lookback like

    condition for C: s(A) & s(B,0.30)



  • 10.  Re: need help in one of the autosys scenarios

    Posted 09-28-2017 07:30 AM

    Another option, that we have used, is the following:

     

    Job A - Runs at 1 AM

    Job B - Runs at 8 PM

    Job C - condition: S(A) & S(B)

    Job D - Reset the status of Job A and Job B to INACTIVE

     

    rajrishi is trying to avoid the case of the following:

     

    Job A runs at 1 AM

    Job B runs at 8 PM

    Job C runs at 8 PM

    Job A runs at 1 AM

    Job C runs at 1 AM

     

    As suggested above, another option is to put A and B in a BOX, which starts at 1 AM.

    The one difference is that I would have the starting condition for C be: S(AB.BOX)