11 Replies Latest reply on Feb 22, 2018 11:44 AM by Eric Wolff

    Job dependencies for jobs with different schedules

      Hello,

       

      I have a situation where job A runs business days and the 1st of the month, job B runs the 1st of the month, and job C runs on Business days and the 1st of the month. When the 1st of the month does roll around I need the job order to be A then B then C. Every other business day I need the job order to be A then C. I tried to handle this with a scheduling group and it's setting 'Adjust Conditions'. From what I can see though this allows jobs A and C to run at the same time on days when B is not scheduled.

       

      Does anyone have any suggestions?

        • 1. Re: Job dependencies for jobs with different schedules

           

           

           

          There are many whys to achieve this. Simple way in my view is to create 2 job streams of same jobs with different scheduling as below

          Job A > Job B > Job C with first of every month in thescheduling

          Job A > Job C with all business days except first of amonth (I think –D1, not sure though)

           

          Regards,

          Sheen

          1 of 1 people found this helpful
          • 2. Re: Job dependencies for jobs with different schedules

            Hello,

             

            I don't know if this is the best solution, but I will probably end up doing it this way.

            • 3. Re: Job dependencies for jobs with different schedules
              Robert Stinnett

              Hi Steve -

               

              You didn't say if this was Distirbuted or Mainframe, so I am going to assume Distributed, but the same functionality is available on the mainframe.  You are going to make use of a Scheduling Group and add a paramter to your config.dat file for Control-M Server.

               

              First, let's talk about the paramter change - you need to add

              CTM_GROUP_ADJUST_DUMMY set to "Y" in your config.dat file Control-M/Server.  This is going to tell Control-M to create a DUMMY job automatically on days when the prerequisite job does not exist.  See the Control-M/Admin guide for more info on this paramter.

               

              Next, we're going to create our scheduling group and set the "Adjust Conditions" parameter to "Yes".

               

              controlm-schedgroup-adjustcondition.png

               

              Now go ahead and create your jobs inside this scheduling group.  For this example I created a three job example flow.  Jobs "ALWAYSRUN_A" and "ALWAYSRUN_C" run every day, and "SOMETIMESRUN_B" only runs two days out of the month.

               

              The schedule is currently for a day when SOMETIMESRUN_B does is not scheduled for execution.

               

              So here is what Enterprise Manager looks like:

               

              em-jobflow-wdummy.png

              Notice there is a SOMETIMESRUNS_B job there?  Let's take a look at it to see what the heck is going on.

               

              dummyjob-view.png

              Control-M created the dummy job for us since SOMETIMESRUN_B was not scheduled to run today.  On days when it is scheduled to run the actual job would be used.

               

              Hope this helps -- drop a line if you need more help!

               

              Thanks,

               

              Robert

              • 4. Re: Job dependencies for jobs with different schedules

                That’s a new learning for me Robert. Thanks very much.

                I believe this feature is available only in 6.4

                 

                Many Thanks

                Sheen

                • 5. Re: Job dependencies for jobs with different schedules
                  Robert Stinnett

                  No problem, glad it could be of help!  I'm not sure what version this first showed up on, unfortunately, though I can tell you I'm certainly glad it

                  is available!

                   

                  Robert

                  1 of 1 people found this helpful
                  • 6. Re: Job dependencies for jobs with different schedules

                    Unfortunately I am using version 6.2 and it doesn't seem to put in the 'dummy' job. Job C will be allowed to run without B there when I check adjust condition on the scheduling group, but the order of A then B, then C is not maintained. For now I have gone with using maybe conditions.

                     

                    ctmldnrs -CALCCOND -ADDMODE NO

                     

                    and

                     

                    ctmldnrs -LOAD "M-*"

                    • 7. Re: Job dependencies for jobs with different schedules
                      Roman Kreindl

                      Hi,

                       

                      I am reactivating this thread because I have a problem that is related to this one. I am already using Scheduling Groups with the CTM_GROUP_ADJUST_DUMMY parameter, which is working fine. Additionaly, I have set CTM_ADJUST_COND_SCOPE to AJF, so Control-M orders dummy jobs not only within the related group but within the whole active jobs file (at least that is what the manual says).

                       

                      I have defined two scheduling groups: one is running only on the last workday of the month (L01), the other one is running on every other workday except the last (-L01). In a job from the first group I have defined a dependency to a job from the second group.

                       

                      But when I order the scheduling group on a normal workday, only the jobs from the "-L01" group are ordered, but no dummy jobs from the "L01" group. The dependencies are not satisfied.

                       

                      What am I doing wrong?

                       

                      Thanks,

                      Roman

                      • 8. Re: Job dependencies for jobs with different schedules

                        Hi Roman,

                         

                        Sorry, but I have not been online much lately. I hope that you have found a solution.

                         

                        If not all that I can reccommend is to check your version. At my company we are still on the antiquated version 6.2 which does not seem to properly support scheduling groups.

                        • 9. Job dependencies for jobs with different schedules

                          Just use a dummy job to bridge the gap on days the second job doesn't run.

                           

                          like this

                           

                          JobA (runs everyday) -publishes out condition JobA-OK

                           

                          JobB (runs on first of the month) -waits for in condition JobA-OK and publishes JobB-OK

                           

                          DumJobB (runs the rest of the month) -waits for in condition JobA-OK and publishes DumJobB-Ok

                           

                          JobC (runs everyday) - waits for JobB-OK OR DumJobB-OK

                           

                          JobA --> (JobB or DumJobB) --> JobC

                          • 10. Re: Job dependencies for jobs with different schedules
                            Michael Bynes

                            An option to enhance the dummy job approach would be to schedule the dummy job on days that the job

                            requiring the option is not scheduled.  This would eliminate the extra dummy job on days that it's not needed.

                            • 11. Re: Job dependencies for jobs with different schedules
                              Eric Wolff

                              Look into the "Maybe" concept.

                               

                              Check out the KSL scripts ADDCOND7 and ADDMAYBE.

                               

                              A "Maybe" condition is a conditrional dependency.  It is defined with a special prefix character notalready used for other Control-M functions.  We use "#" (pound/hash).

                               

                              Job A schedules daily and sets Out of JOBA-OK

                               

                              Job B schedules monthly.  Needs In of JOBA-OK.  Sets Out of #JOBB-OK

                               

                              Job C schedules daily.  Needs Ins of JOBA-OK and #JOBB-OK.

                               

                              We run the ADDCOND7 script at 1600 and 0700  (New day is 1000).  The script basically looks for In conditions with the "#" prefix.  When found, it sees if any jobs are in the schedule that will satisfy it.  If found, the  script leaves it alone, as it will be satisfied by processing.  If no match, the script adds the "missing" condition, resolving it for the job.  This creates the ability of conditional prerequisites without having to create bogus dummy jobs, etc.