It is currently 20 Nov 2018 12:36


Post new topic  Reply to topic  [ 12 posts ] 
Author Message
PostPosted: 30 May 2007 1:33 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Feb 2007 12:00
Posts: 43
Hi,

I need help to schedule the following job

A cyclic job which runs every 5 mins, if the job fail consecutively 3 times in a row it has to stop cyclic.

Thanks,


Top
   
 Post subject: maybe it will work:
PostPosted: 30 May 2007 2:39 
if it is a command, append to cmdline "echo count%%COUNT". Then in sysout wait for count3 to stop cyclic.
ON STMN * CODE NOTOK DO SET_VAR %%COUNT = %%COUNT %%PLUS 1
ON STMN * CODE OK DO SET_VAR %%COUNT = 0
ON STMN * CODE "*count3*" DO STOP_CYCLIC

Try it, or use similar logic. I'm not sure, if COUNT + 1 will work with one variable :(


Top
   
 Post subject:
PostPosted: 31 May 2007 10:31 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Feb 2007 12:00
Posts: 43
Without initializing COUNT to 0, COUNT will be assigned to CTMERR+1.

We need to first initialize the COUNT value to zero. If we initialize the COUNT value to zerp in SET then for the next run it will get reassigned to zero again.


Top
   
PostPosted: 31 May 2007 11:27 
just my suggestion:
if the variable is local variable - job variable, it will asign 0 each time.
Try it with group variable or global variable, so initiate the variable in the upper "layer" so it wont be initialized (to zero) when job is being executed.


Top
   
PostPosted: 11 Jun 2007 12:50 
Offline
Nouveau
Nouveau
User avatar

Joined: 20 Jan 2006 12:00
Posts: 473
Hi,

In this suggestion i use : Over Lib + Global Var

Try this:

1) On the server where reside the Control-M/Server create one directory named <BadRun3> (if you want to check after 3 run NOTOK)
Example: <your CONTROLM directory>/overlib/BadRun3

2) In this directory named <BadRun3> create one script with the same name of your cyclic job.
This script invoqued just the command : echo "Job was stopped because FAILED 3 TIMES consecutively"

3) In the 'Definition' of the cyclic job define the normal Path and one Over Lib like this:
<your CONTROLM directory>/overlib/BadRun%%FAILCOUNT

4) In the 'Set' windows define this:
%%OVERLIB = <your CONTROLM directory>/overlib/BadRun%%FAILCOUNT

5) In the 'Steps' windows define this:
On Stmt = * Code = OK
DO Set-Var %%\FAILCOUNT 0
On Stmt = * Code = NOTOK
DO Set-Var %%\FAILCOUNT %%FAILCOUNT %%PLUS 1
On Stmt = * Code *FAILED 3 TIMES*
DO Stop Cyclic
DO Set-Var %%\FAILCOUNT 0
DO Shout To = ECS Urgn = Urgent Msg = %%JOBNAME Stopped after 3 consecutively run KO

In this logic the normal path is overloaded when the Gloabal Variable %%FAILCOUNT is set to 3 and the job submitted ran only the echo command.
In the SYSOUT analysed we found *FAILED 3 TIMES* and we stopped the cyclic job.

Log example, at the 4 run the job was stopped:

11/06/07 12:11:19 CS5065 ORDERED JOB:25303; DAILY FORCED, ODATE 20070611
11/06/07 12:11:20 SL5105 SUBMITTED TO suns01tst
11/06/07 12:11:25 TR5101 STARTED AT 20070611121120 ON suns01tst
11/06/07 12:11:25 TR5120 JOB STATE CHANGED TO Executing
11/06/07 12:11:30 SL5120 JOB STATE CHANGED TO Wait Rerun
11/06/07 12:11:30 TR5216 DO SETVAR '%%FAILCOUNT'='1' performed
11/06/07 12:11:30 TR5120 JOB STATE CHANGED TO Analyzed
11/06/07 12:11:30 TR5134 ENDED NOTOK
11/06/07 12:11:30 TR5100 ENDED AT 20070611121130. OSCOMPSTAT 12. RUNCNT 1
11/06/07 12:11:30 SL5120 JOB STATE CHANGED TO Wait Time Window
11/06/07 12:13:01 SL5105 SUBMITTED TO suns01tst
11/06/07 12:13:06 TR5101 STARTED AT 20070611121301 ON suns01tst
11/06/07 12:13:06 TR5120 JOB STATE CHANGED TO Executing
11/06/07 12:13:11 SL5120 JOB STATE CHANGED TO Wait Rerun
11/06/07 12:13:11 TR5120 JOB STATE CHANGED TO Analyzed
11/06/07 12:13:11 TR5134 ENDED NOTOK
11/06/07 12:13:11 TR5216 DO SETVAR '%%FAILCOUNT'='2' performed
11/06/07 12:13:11 TR5100 ENDED AT 20070611121311. OSCOMPSTAT 12. RUNCNT 2
11/06/07 12:13:11 SL5120 JOB STATE CHANGED TO Wait Time Window
11/06/07 12:15:01 SL5105 SUBMITTED TO suns01tst
11/06/07 12:15:07 TR5101 STARTED AT 20070611121501 ON suns01tst
11/06/07 12:15:07 TR5120 JOB STATE CHANGED TO Executing
11/06/07 12:15:12 SL5120 JOB STATE CHANGED TO Wait Rerun
11/06/07 12:15:12 TR5216 DO SETVAR '%%FAILCOUNT'='3' performed
11/06/07 12:15:12 TR5134 ENDED NOTOK
11/06/07 12:15:12 TR5100 ENDED AT 20070611121512. OSCOMPSTAT 12. RUNCNT 3
11/06/07 12:15:12 TR5120 JOB STATE CHANGED TO Analyzed
11/06/07 12:15:16 SL5120 JOB STATE CHANGED TO Wait Time Window
11/06/07 12:17:02 SL5105 SUBMITTED TO suns01tst
11/06/07 12:17:07 TR5101 STARTED AT 20070611121702 ON suns01tst
11/06/07 12:17:07 TR5120 JOB STATE CHANGED TO Executing
11/06/07 12:17:12 TR5100 ENDED AT 20070611121712. OSCOMPSTAT 0. RUNCNT 4
11/06/07 12:17:13 SL5219 CYCLIC ATTRIBUTE REMOVED DUE TO DOSTOPCYCLIC
11/06/07 12:17:13 SL5120 JOB STATE CHANGED TO Post processed
11/06/07 12:17:13 TR5201 SHOUT TO ECS PERFORMED
11/06/07 12:17:13 TR5216 DO SETVAR '%%FAILCOUNT'='0' performed
11/06/07 12:17:13 TR5133 ENDED OK
11/06/07 12:17:13 TR5120 JOB STATE CHANGED TO Analyzed

I hope to help you.
Regards
Walty


Top
   
 Post subject:
PostPosted: 30 Jul 2007 10:53 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Feb 2007 12:00
Posts: 43
Working fine..Thank Walty!!!


Cheers,


Top
   
 Post subject:
PostPosted: 11 May 2010 11:25 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 May 2008 12:00
Posts: 7
Hi,

I would like to do the same but I don't know why, my cyclic job never stop.

My directory is BadRun2 with a script ping_markit.sh (the same launch by my cyclic job) with a echo command :

echo "Job was stopped because FAILED 2 TIMES consecutively"

On my log I never see the stop cyclic command and the shout perform :

11/05/10 11:09:28 SL5208 QUANTITATIVE RESOURCE IRQ_IUP QUANTITY 1 ALLOCATED
11/05/10 11:09:28 SL5105 SUBMITTED TO cmvi6f22.int.cm.par.emea.cib
11/05/10 11:09:32 TR5101 STARTED AT 20100511110928 ON cmvi6f22.int.cm.par.emea.cib
11/05/10 11:09:32 TR5120 JOB STATE CHANGED TO Executing
11/05/10 11:09:42 TR5100 ENDED AT 20100511110942. OSCOMPSTAT 0. RUNCNT 40
11/05/10 11:09:42 TR5707 DO SETVAR '%%FAILCOUNT'='0' performed
11/05/10 11:09:42 TR5133 ENDED OK
11/05/10 11:09:42 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 11:09:43 SL5214 QUANTITATIVE RESOURCES RELEASED
11/05/10 11:09:43 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 11:09:43 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 11:10:00 SL5208 QUANTITATIVE RESOURCE IRQ_IUP QUANTITY 1 ALLOCATED
11/05/10 11:10:00 SL5105 SUBMITTED TO cmvi6f22.int.cm.par.emea.cib
11/05/10 11:10:01 TR5101 STARTED AT 20100511111000 ON cmvi6f22.int.cm.par.emea.cib
11/05/10 11:10:01 TR5120 JOB STATE CHANGED TO Executing
11/05/10 11:10:08 TR5100 ENDED AT 20100511111008. OSCOMPSTAT 1. RUNCNT 41
11/05/10 11:10:08 TR5707 DO SETVAR '%%FAILCOUNT'='1' performed
11/05/10 11:10:08 TR5134 ENDED NOTOK
11/05/10 11:10:08 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 11:10:09 SL5214 QUANTITATIVE RESOURCES RELEASED
11/05/10 11:10:09 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 11:10:12 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 11:11:02 SL5208 QUANTITATIVE RESOURCE IRQ_IUP QUANTITY 1 ALLOCATED
11/05/10 11:11:02 SL5105 SUBMITTED TO cmvi6f22.int.cm.par.emea.cib
11/05/10 11:11:03 TR5101 STARTED AT 20100511111102 ON cmvi6f22.int.cm.par.emea.cib
11/05/10 11:11:03 TR5120 JOB STATE CHANGED TO Executing
11/05/10 11:11:11 TR5100 ENDED AT 20100511111111. OSCOMPSTAT 1. RUNCNT 42
11/05/10 11:11:11 TR5707 DO SETVAR '%%FAILCOUNT'='2' performed
11/05/10 11:11:11 TR5134 ENDED NOTOK
11/05/10 11:11:11 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 11:11:11 SL5214 QUANTITATIVE RESOURCES RELEASED
11/05/10 11:11:11 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 11:11:16 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 11:12:02 SL5208 QUANTITATIVE RESOURCE IRQ_IUP QUANTITY 1 ALLOCATED
11/05/10 11:12:02 SL5105 SUBMITTED TO cmvi6f22.int.cm.par.emea.cib
11/05/10 11:12:09 TR5101 STARTED AT 20100511111202 ON cmvi6f22.int.cm.par.emea.cib
11/05/10 11:12:09 TR5120 JOB STATE CHANGED TO Executing
11/05/10 11:12:19 TR5100 ENDED AT 20100511111219. OSCOMPSTAT 1. RUNCNT 43
11/05/10 11:12:19 TR5707 DO SETVAR '%%FAILCOUNT'='3' performed
11/05/10 11:12:19 TR5134 ENDED NOTOK
11/05/10 11:12:19 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 11:12:20 SL5214 QUANTITATIVE RESOURCES RELEASED
11/05/10 11:12:20 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 11:12:23 SL5120 JOB STATE CHANGED TO Wait Time Window

Is the procedure correct ?

Many thanks


Top
   
 Post subject:
PostPosted: 11 May 2010 12:16 
Offline
Nouveau
Nouveau
User avatar

Joined: 20 Jan 2006 12:00
Posts: 473
Hi,

In your cyclic job have you set this parameters in Steps windows?

On Stmt = * Code *FAILED 2 TIMES*
DO Stop Cyclic
DO Set-Var %%\FAILCOUNT 0
DO Shout To = ECS Urgn = Urgent Msg = %%JOBNAME Stopped after 2 consecutively run KO

_________________
Best regards
Walty


Top
   
 Post subject:
PostPosted: 11 May 2010 1:56 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 May 2008 12:00
Posts: 7
Yes of course and my cyclic job never stop !


Top
   
 Post subject:
PostPosted: 11 May 2010 6:19 
Offline
Nouveau
Nouveau
User avatar

Joined: 20 Jan 2006 12:00
Posts: 473
Hi Thierry-75,

strange ... but try this:

- Execute this action before you try to run your test (perhaps your var %%FAILCOUNT as varexpr >3 due to previus tests)

ctmvar -ACTION list (to list all GLOBAL Autoedit Variable and check if the var %%FAILCOUNT is present and varexpr is 0)
If no :
ctmvar -ACTION DELETE -VAR "%%\FAILCOUNT" (to delete GLOBAL Autoedit Variable )

- Run your test again

I re-tried the same test:

Date Time Code Job Name Job Id ----- Message -----

11/05/10 16:57:08 CS5065 ORDERED JOB:12860; DAILY FORCED, ODATE 20100511
11/05/10 16:57:08 SL5105 SUBMITTED TO suns01tst
11/05/10 16:57:14 TR5101 STARTED AT 20100511165708 ON suns01tst
11/05/10 16:57:14 TR5120 JOB STATE CHANGED TO Executing
11/05/10 16:57:19 TR5100 ENDED AT 20100511165719. OSCOMPSTAT 12. RUNCNT 1
11/05/10 16:57:19 TR5707 DO SETVAR '%%FAILCOUNT'='1' performed
11/05/10 16:57:19 TR5134 ENDED NOTOK
11/05/10 16:57:19 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 16:57:19 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 16:57:20 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 16:59:00 SL5105 SUBMITTED TO suns01tst
11/05/10 16:59:05 TR5101 STARTED AT 20100511165900 ON suns01tst
11/05/10 16:59:05 TR5120 JOB STATE CHANGED TO Executing
11/05/10 16:59:10 TR5100 ENDED AT 20100511165910. OSCOMPSTAT 12. RUNCNT 2
11/05/10 16:59:10 TR5707 DO SETVAR '%%FAILCOUNT'='2' performed
11/05/10 16:59:10 TR5134 ENDED NOTOK
11/05/10 16:59:10 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 16:59:11 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 16:59:11 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 17:01:00 SL5105 SUBMITTED TO suns01tst
11/05/10 17:01:05 TR5101 STARTED AT 20100511170100 ON suns01tst
11/05/10 17:01:05 TR5120 JOB STATE CHANGED TO Executing
11/05/10 17:01:11 TR5100 ENDED AT 20100511170110. OSCOMPSTAT 12. RUNCNT 3
11/05/10 17:01:11 TR5707 DO SETVAR '%%FAILCOUNT'='3' performed
11/05/10 17:01:11 TR5134 ENDED NOTOK
11/05/10 17:01:11 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 17:01:11 SL5120 JOB STATE CHANGED TO Wait Rerun
11/05/10 17:01:11 SL5120 JOB STATE CHANGED TO Wait Time Window
11/05/10 17:03:00 SL5105 SUBMITTED TO suns01tst
11/05/10 17:03:05 TR5101 STARTED AT 20100511170300 ON suns01tst
11/05/10 17:03:05 TR5120 JOB STATE CHANGED TO Executing
11/05/10 17:03:10 TR5100 ENDED AT 20100511170310. OSCOMPSTAT 0. RUNCNT 4
11/05/10 17:03:10 TR5201 SHOUT TO ECS PERFORMED
11/05/10 17:03:10 TR5707 DO SETVAR '%%FAILCOUNT'='0' performed
11/05/10 17:03:10 TR5133 ENDED OK
11/05/10 17:03:10 TR5120 JOB STATE CHANGED TO Analyzed
11/05/10 17:03:11 SL5219 CYCLIC ATTRIBUTE REMOVED DUE TO DOSTOPCYCLIC
11/05/10 17:03:11 SL5120 JOB STATE CHANGED TO Post processed

Sysout for the first 3 runs is:
+ echo run run run
run run run
+ exit 12

Sysout for the 4 run is:
+ echo Job was stopped because FAILED 3 TIMES consecutively
Job was stopped because FAILED 3 TIMES consecutively

My test jobs:
suns01tst[126] cd forum
suns01tst[128] more Stop-job-cyclic (your cyclic job)
#!/bin/sh
# Test stop cyclic job after 3 run NOTOK
echo "run run run "
exit 12

suns01tst[130] cd BadRun3
suns01tst[133] more Stop-job-cyclic
#!/bin/sh
# Test stop cyclic job after 3 run NOTOK
echo "Job was stopped because FAILED 3 TIMES consecutively"

_________________
Best regards

Walty


Top
   
 Post subject:
PostPosted: 12 May 2010 9:05 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 May 2008 12:00
Posts: 7
Ok ok thank you very much, I find what was wrong.

When you want to use an overlib for a job running on a Control-M agent which is no the control-m server's agent, you need to put the overlib on the agent.

Many thanks for your help.


Top
   
 Post subject:
PostPosted: 21 May 2010 4:11 
Offline
Nouveau
Nouveau
User avatar

Joined: 21 May 2010 12:00
Posts: 1
Hi Please let me know how to do it the same in AS/400 , it is possible to create the "echo" in AS/400 IFS???


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved