Hi all,
can i set a job to force ok another job upon successful completion.
please advice
thanks
Forcing OK a job from another job
thanks chookgate on the reply but it seems im trying ctmpsm -LISTJOB command to obtain the order id of the other job
ctmpsm -LISTJOB WAITCON -SORT A
should i change the command on job B to below?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
.
.
ctmpsm -LISTJOB WAITCON -SORT A
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.
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.