How to post a job from a job that's currently executing
How to post a job from a job that's currently executing
How can I order a job to run, from another job that exceeds a specified run time?
Is it possible to post an In-Condition from another job when the other job exceeds a time limit?
For example: If JOB_A runs >60 minutes, how can I have JOB_B start?
Thanks.
Is it possible to post an In-Condition from another job when the other job exceeds a time limit?
For example: If JOB_A runs >60 minutes, how can I have JOB_B start?
Thanks.
How to post a job from a job that's currently executing
If an exectime can do a 'trigger' of another job, that may be what I'm looking for. Let me know how this is set-up.
Hi Mel_A,
Just a little example that order Job(b) if a Job(a) exceeds a specified parameters like LATETIME, LATESUB or EXECTIME
Step1:
From the "ctmsys" menu, goto "Shout Destination Tables" and define a shout destination with type "P" (program), Address Type "S" (server), Logical Destination "Order_Job" and Physical Destination "$HOME/ctm_server/my_jobs_directory/Order_Job.sh".
Step2:
Go to your "$HOME/ctm_server/my_jobs_directory and create a script named "Order_Job.sh", which contains the following lines:
#!/bin/sh
My_Schedtab=`echo $2 | awk '{print $1}'`
My_Jobname=`echo $2 | awk '{print $2}'`
My_Date=`echo $2 | awk '{print $3}'`
# order job now
ctmorder -SCHEDTAB $My_Schedtab -JOBNAME $My_Jobname -ODATE $My_Date -FORCE Y &
Note:
- The script must reside on the CONTROL-M/S machine
- The ampersand (&) at the end of the command is mandatory. This must be present for this solution to work.
- The variable that contains parameters received from SHOUT pgm is $2
Step3:
Job definition
- Goto the "PostProc" tab and define a shout WHEN LATETIME, LATESUB or EXECTIME
- in the Param box put <your value>
- in the To box put "Order_Job"
- in the Message Box put "your_parameters separed by blank" (ie : SCHEDTAB JOBNAME ODATE)
The parameters for the "Order_Job.sh" script in this example.
I hope this help you.
Just a little example that order Job(b) if a Job(a) exceeds a specified parameters like LATETIME, LATESUB or EXECTIME
Step1:
From the "ctmsys" menu, goto "Shout Destination Tables" and define a shout destination with type "P" (program), Address Type "S" (server), Logical Destination "Order_Job" and Physical Destination "$HOME/ctm_server/my_jobs_directory/Order_Job.sh".
Step2:
Go to your "$HOME/ctm_server/my_jobs_directory and create a script named "Order_Job.sh", which contains the following lines:
#!/bin/sh
My_Schedtab=`echo $2 | awk '{print $1}'`
My_Jobname=`echo $2 | awk '{print $2}'`
My_Date=`echo $2 | awk '{print $3}'`
# order job now
ctmorder -SCHEDTAB $My_Schedtab -JOBNAME $My_Jobname -ODATE $My_Date -FORCE Y &
Note:
- The script must reside on the CONTROL-M/S machine
- The ampersand (&) at the end of the command is mandatory. This must be present for this solution to work.
- The variable that contains parameters received from SHOUT pgm is $2
Step3:
Job definition
- Goto the "PostProc" tab and define a shout WHEN LATETIME, LATESUB or EXECTIME
- in the Param box put <your value>
- in the To box put "Order_Job"
- in the Message Box put "your_parameters separed by blank" (ie : SCHEDTAB JOBNAME ODATE)
The parameters for the "Order_Job.sh" script in this example.
I hope this help you.
Best regards
Walty
Walty
How to post a job from a job that's currently executing
Thank you so much. It's much appreciated.
I'm now in the process of testing it in batch. I will let you know.
Thanks!
I'm now in the process of testing it in batch. I will let you know.
Thanks!
How to post a job from a job that's currently executing
When the exectime of JOB_A exceeds a time limit, a job (JOB_C) is ordered in. It worked. The test was successful. Thank you.
This brings up another question.
Can this job that was brought in (JOB_C) be dependent on a file transmission? In other words, Can JOB_C once ordered, check for a file that has either come in or not?
This brings up another question.
Can this job that was brought in (JOB_C) be dependent on a file transmission? In other words, Can JOB_C once ordered, check for a file that has either come in or not?
Re: How to post a job from a job that's currently executing
The BIM job do this in a flexible manner, defined at "flow side" (the bim job mantain under control the flow were is attached).
The other solution, without BIM, is to use the method well described by Walty (defined at "job side").
The other solution, without BIM, is to use the method well described by Walty (defined at "job side").