Unfortunately the only option currently offered in Control-M is the FORCE-JOB option in the STEPS tab to get additional jobs on the Active Job File (AJF) based on conditional logic that you have setup in your job definition. Forcing a job onto the system bypasses the scheduling criteria, which can present a problem if we don’t want certain jobs running on certain dates.
To get around this I wrote a very small batch file that can be used to activate the ctmorder command on the Control-M Server. You can set this up as a shout destination to order jobs onto the system, and still respect the scheduling criteria.
First, save this batch file to a location your Control-M server can access. Call it something like orderjob.bat.
REM *** Start Batch File ***
REM Order Job Utility for Control-M Shouts
REM October 2007, Robert Stinnett
set datestamp=%datestamp: =0%
for /f "tokens=1,2,3 delims=;" %%a in ("%parameters%") do (
ctmorder -SCHEDTAB %schedtab% -JOBNAME %jobname% -ODATE %odate% -FORCE n >> C:\logs\orderjob.log
REM *** End Batch File ***
Next, on your Control-M server setup a shout destination pointing to the batch file.
Logical Name: orderjob
Value: C:\path to\orderjob.bat
Finally, you are ready to use it.
In your job definition you can simply shout to orderjob and pass in the following parameters: tablename;jobname;orderdate
Since the shout only allows you to send through one string as the message, we must use the semicolons (;) to separate out values out. In our batch file above we check for the delimiters and separate the values out.
The batch file will also log the results of the ctmorder command to a log file. This can be useful for auditing or debugging purposes since a shout does not return back to the job any output.