Need help : ON & CODE issue.

All questions about Control-M jobs definitions
Post Reply
User avatar
Senthilkumar
Nouveau
Nouveau
Posts: 12
Joined: 03 Feb 2009 12:00
Location: Bangalore

Need help : ON & CODE issue.

Post by Senthilkumar » 19 Dec 2012 9:06

Hi All,

Need help on the below

We have batch of 50 jobs and in that middle of the job (for ex : 28), which it returns the code as 180 then it should continue the batch and mail sent to the customer, other than 180 and non zero then it should stop the batch and mail need to send to the customer that the batch is stopped.

I have the below steps configuration

On stmt *
code =180
do condition ABC
date ODAT
sign +

on stmt *
code >180
do mail

on stmt *
code <180>1 but here 180 also will come under this catagory, and two mails will generate and leads to confusion.

How can pass the multiple code in a single code statement like "compstat > 0 AND compstat <180" is it possible ? if it is possible then please do let me know what changes needs to be done.

Awaiting your updates.

Thank you,
Senthil

User avatar
bglr_admin
Nouveau
Nouveau
Posts: 7
Joined: 15 Dec 2011 12:00

Post by bglr_admin » 19 Dec 2012 12:28

HI,
I don't understand, why all this required, You can just add a on condition for COMPSTAT=180 then do OK & do mail,
This serves your purpose

User avatar
Senthilkumar
Nouveau
Nouveau
Posts: 12
Joined: 03 Feb 2009 12:00
Location: Bangalore

Post by Senthilkumar » 19 Dec 2012 2:54

Hi,

The Requirement is if the job failure with other error they need the mail stating the "job failed with Error. Hence STOPPING the Batch chain"

If the job is failed with 180 then it should continue the batch send an email stating that " FAILED with ERROR 180. Hence Continuing the BATCH".


Thanks,
Senthil.

User avatar
Sommi
Nouveau
Nouveau
Posts: 7
Joined: 13 Jan 2011 12:00
Location: India

Post by Sommi » 31 Dec 2012 11:51

Hi Senthil,
You can try the below:
On Stmt=*
Code=180
Do Ok
On Stmt=*
Code =180
Do mail"FAILED with ERROR 180"
On Stmt=*
Code =COMPSTAT>0
Do mail"Job Failed with error"
On Stmt=*
Code =COMPSTAT>180
Do mail"Job Failed with error"

Thanks,
Soumya

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

Post by Winsome » 31 Dec 2012 12:59

Hello,

Your job should end ok and stop for Code 0, hence you do not have to mention any clause in Steps tab for that value, unless you have specified a different return code upon successful completion and if it is a One time run job.

The commands would be different for a batch with all cyclic jobs and a batch with non cyclic jobs.

For cyclic job
On Stmt * Code COMPSTAT!0
Do Mail FAILED WITH ERROR %%COMPSTAT
Do Stop cyclic

On Stmt * Code COMPSTAT=180
Do Rerun

For non cyclic
On Stmt * Code COMPSTAT!0
Do Mail FAILED WITH ERROR %%COMPSTAT

On Stmt * Code COMPSTAT=180
Do Rerun

On Stmt * Code COMPSTAT=0
Do Rerun

Hope that helped.
Thanks!Winsome

Post Reply