Control-M couldn't trap the fail job

Post Reply
User avatar
asenna25
Nouveau
Nouveau
Posts: 1
Joined: 27 Oct 2010 12:00

Control-M couldn't trap the fail job

Post by asenna25 » 27 Oct 2010 12:10

Hello, We scheduled some .bat file (written in perl) to be run on Control-M. when the job failed, in the .bat file, we return error code 1 (i.e. exit 1). However, the Control-M still gives it a green light. and start the subsequent jobs.

Any ideas? I'm very new to control-M environment.

User avatar
Winsome
Nouveau
Nouveau
Posts: 16
Joined: 06 Jul 2010 12:00
Location: Chennai
Contact:

Post by Winsome » 27 Oct 2010 5:01

Well, I am not sure why it does that, but i can tell you a way how you can avoid the other jobs being triggered.
Instead of putting the condition in the OUT Condition of the Conditions tab, you can have it in the Steps tab as:
On Stmt * Code COMPSTAT=0
Do Condition Name= "condition name" Date ODAT Sign +

This way it will only post the condition when the return code is 0 (that is Ended OK). And make sure you don't mention anything in the OUT condition of the conditions tab. You can put as many OUT conditions here as you want.

Let me know if you have any doubts.

NOTE: condition name implies the condition which triggers the next job
Date can be ODAT, PREV, NEXT or **** as per your preference

Post Reply