6 Replies Latest reply on Dec 6, 2018 11:13 AM by Adriano Gomes

    How to automatically order a job for one month

    Zhou Robbie

      I have a job that needs to run for a month, but can only be manually ordered everyday, how to automatically run it.Thank you!!

        • 1. Re: How to automatically order a job for one month
          Mark Francome

          Well if you just want it like that then create it without any scheduling criteria.

           

          Then tell the user when they are manually ordering to force the job in.

          2 of 2 people found this helpful
          • 2. Re: How to automatically order a job for one month
            Zhou Robbie

            Thanks!

            The job is in datastage to extract data from oracle.I need to extract one month of data from the oracle to the corresponding folder for each day.

            Now i just do like you said,manually ordering to force the job in.

            I want to automatically run it.

            Thank you!

            • 3. Re: How to automatically order a job for one month
              Mark Francome

              If you did want to run it automatically (without the manual force) then the simple way would be to schedule every day and then use the "Activity Period" settings -

              If you press "view schedule" to confirm -

              • 4. Re: How to automatically order a job for one month
                Adriano Gomes

                Hi Zhou Robbie

                 

                If i undestood your requirement correctly: You want to define/plan a schedule for a job from a month/30 days time frame?

                 

                There are some approaches that can be taken in order to have such job automattically ordered by Control-M.

                 

                First, you need to have the folder that hold your job/jobs belonging to the "Automatic (Daily)" or a "Specific Daily" named "SYSTEM" as the "order method". This will "say" to Control-M to scan all jobs belonging to SYSTEM daily for scheduling criterion to make then active.

                      If this is the not case, you may have your folder assigned to a different "order method" NAME, Your Control-M Administrator have to perform the load of the daily that you folder belong to by running a Control-M job/Util (ctmudly) that will scan your job Folder at given time during the current day and make them active if there are any eligible.

                 

                 

                Second, You have to select on the JOB Form,  the scheduling criterion that will allow you Job to be elegible for being orderd every day of a given moth.

                I would recomend thse steps:

                 

                 

                1) Select "Month Days" from "Schedule" filed and press "All" button.

                Also, you can control the timeframe this job will be active, by selecting a RAGE of days for that specific month

                 

                2)or, Create a month calendar and fill in the month days you want you job to be ordered at,  and select "calendar based" on the job form "schedule". Then select you calendar NAME from the calendar list;

                 

                 

                You will need to maintain the month day calendar fill in, and/or the "Activity period" if you desire the job to be active longer than a month.

                 

                lastly, you can select "View Schedule" button in order to validate your planning requirements.

                 

                NOTE: Until you Trust the process and the planning, You can also, select "requires user confirmation", so the job will be active but only run by manual user confirmation on the EM GUI, or by using Control-M Self Service mobile.

                 

                Hope that it helps you, 

                 

                My Best Regards

                 

                A>Gomes

                2 of 2 people found this helpful
                • 5. Re: How to automatically order a job for one month
                  Zhou Robbie

                  Thanks!

                  I tried but failed..

                  It is December,I want to run in August immediately.

                  The important thing is that I want the job to run automatically.Because I will select the date 30 times,select 2018/8/1 to run the time,then 2008/8/2...to 2018/8/31.

                  This is a very waste of time,so I how to select a month 1 times,then control-m will run 30 times for the month automatically.

                  Thank you.

                  • 6. Re: How to automatically order a job for one month
                    Adriano Gomes

                    Hi Zhou Robbie

                     

                    Sorry for wasting your time.  Definitelly you can acomplish this, with two clicks.

                    This is a very interesting and challenging situation: If You want to plan and run your jobs as PAST August 2018 Order DATE and have them accepted by control-M, I suggest the following:

                     

                    1) Select "Advanced Scheduling" and click "All" button for bolded "Days of the month" and "Aug" on for bolded "Order on Months".

                    Indeed, whatever date plans that fit past August 2018 will work for this.

                     

                    August_2018.png

                    2) The secret sauce is to make Control-M to accept the job as if the DATES/ODATE were past August 1-31. To do so, unfortunately it will not be by clicking CTM Client screen. It will only allow you to select one by one, manually, DATE by DATE, like the screen below.

                     

                    This would be a subject matter to BMC add new feature to allow multiples dates ordering selection.

                     

                    3) Finally, The way I see this happening is by DEFINE a NEW CTMODER utility  with "Embedded Script" job to do this task.

                     

                    here is the script details:

                     

                    #"Copy and paste it to the CTMORDER JOB"

                    for (( i=1; i<=31 ;  i++  )) ; do

                    if [ $i -le 10 ]; then  DAY=0$i ; else DAY=$i ; fi

                    ctmorder -FOLDER Past_August_2018 -NAME "*" -ODATE 201808$DAY -UNIQUE y

                    sleep 2

                    done

                    #End Sripting

                     

                     

                    NOTE: YOU can USE %%$ODATE to send AUGUST DATEs (DAY) parameter to you QUERY.

                     

                     

                    This way, Control-M will perform ordering jobs from August 01st to 31st like this below.

                     

                    Please find attached the exported XML for your reference.

                     

                    Rgds

                     

                    AGomes

                    3 of 3 people found this helpful