Forcing OK a job from another job

All questions about Control-M jobs definitions
Post Reply
User avatar
sjnbilko
Nouveau
Nouveau
Posts: 3
Joined: 20 Aug 2009 12:00

Forcing OK a job from another job

Post by sjnbilko » 20 Mar 2012 9:41

Hi all,

can i set a job to force ok another job upon successful completion.
please advice
thanks

User avatar
sjnbilko
Nouveau
Nouveau
Posts: 3
Joined: 20 Aug 2009 12:00

Post by sjnbilko » 21 Mar 2012 4:23

thanks chookgate on the reply but it seems im trying ctmpsm -LISTJOB command to obtain the order id of the other job
Job A - job (in waiting confirmation status) to be FORCE OK
Job B - job to run ctmpsm to obtain order id & force ok A

CMD:

+ ctmpsm -LISTJOB WAITCONFIRM -SORT A

Jobs Waiting for Confirmation
ORDERID JOBNAME TYPE ODATE STATE STATUS FROMTIME UNTIL
-------- ----------------- ---- ------- ------- ------ -------- -----
.
.
0000gu8n A CMD 20120321 Wait Con Hold
.
.
should i change the command on job B to below?

ctmpsm -LISTJOB WAITCON -SORT A

User avatar
meshearer
Nouveau
Nouveau
Posts: 14
Joined: 08 Dec 2008 12:00
Location: Texas
Contact:

Post by meshearer » 22 Mar 2012 3:45

I currently do this very task with a shout to a script I created called "killjob.sh":

When job A finishes, it sends a shout to destination "Kill_job". The message of the shout contains the name of job B.

In the steps panel of job B I added the following lines:

On Statement Stmt=* Code= COMPSTAT=143
Do OK

The script I created below "kills" job B:

#!/bin/ksh
#
# This script can be used to "kill" a running job in BMC.
#
# $2 is the "JOBNAME" of the job that you want to "kill".
#

ctmkilljob -JOBNAME $2 &

exit

#
# EOF
#

I know that it doesn't force job B OK but with the addition of the DO OK for completion code 143, it basically does the same thing.

User avatar
meshearer
Nouveau
Nouveau
Posts: 14
Joined: 08 Dec 2008 12:00
Location: Texas
Contact:

Post by meshearer » 22 Mar 2012 8:30

Ignore my earlier post, I was assuming that Job B was already executing. My solution was for two filewatches looking for the same file to be created on different servers.

User avatar
meshearer
Nouveau
Nouveau
Posts: 14
Joined: 08 Dec 2008 12:00
Location: Texas
Contact:

Post by meshearer » 22 Mar 2012 9:01

sjnbilko,

To get the order id of Job B you could use this command:

ctmpsm -listall allfields |grep <job_name> | awk '{print $1}'

Hope this helps.

Post Reply