Keep job active after success run

Some examples running with Control-M and Control-EM database.
Post Reply
User avatar
GrandSteph
Nouveau
Nouveau
Posts: 17
Joined: 24 Oct 2011 12:00

Keep job active after success run

Post by GrandSteph » 23 Jan 2014 6:13

Hi all,
Is it possible to keep a job active after a succesfull run for several days? Basically today, we can't rerun a job on Monday morning that was executed on friday evening because all succesfull jobs are removed from the active queue when we do a refresh every day. After the refresh only pending, executing and failed job remain.

Thank you.

User avatar
gglau
Nouveau
Nouveau
Posts: 317
Joined: 13 Jun 2007 12:00

Post by gglau » 24 Jan 2014 11:02

Put the job on hold!

steve_r

Keep job active after success run

Post by steve_r » 25 Jan 2014 6:20

Assuming the job is triggered by an 'in' condition, you could set the job to do a rerun on successful completion - ensuring the initial run cleans up the trigger condition first - the job will then wait until you manually supply the condition some time later.

User avatar
GrandSteph
Nouveau
Nouveau
Posts: 17
Joined: 24 Oct 2011 12:00

Post by GrandSteph » 27 Jan 2014 3:50

Thanks Guys.

Unfortunatly none of the answer are satisfying to me. We are really looking for a way to do this without manual intervention. Meaning, we want to eventually rerun a job on monday that was posted on Friday (it happens only a very limited number of time). Only whenever an issue occured and the job needs to be rerun for that date.

It seems counterintuitive for a widely used scheduler to not be able to rerun a job over the week end on Monday.

Thanks anyway,

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 29 Jan 2014 11:04

Hi GrandSteph,

little suggestion for your issue

Step 1:
Create a script file accessible by your Control-M Server.
This script will invoke the 'ctmpsm' utility

UNIX:
#!/bin/sh
ctmpsm -UPDATEAJF $2 HOLD &


- the ampersand (&) must be present at the end of the command

WINDOWS:
@ECHO OFF
cmd /C ctmpsm -UPDATEAJF %2%


- the /C must be present (open a command shell, run and close it)

Step 2:
Create on your Control-M/Server a <new logical entry> in Shout Destination Tables using <ctm_sys>
- ctmsys
- opt1 (Shout Destination Tables)
- opt1 (Create/Modify a Table)
- Table to create/modify or 'q' to quit [SYSTEM]: <ENTER>
- This table is currently active. Do you want to continue (y/n) [n]: y <ENTER>
- Enter Option: n <ENTER>
- Dest. Type: p <ENTER>
- Address Type: s <ENTER>
- Logical Name:HOLD-JOB<ENTER>
- Physical Name:/home/ctmuser/scripts/hold-job.sh (full path name)
- Press q to exit from the ctmsys menu

Step 3:
Define in your job a shout Message
- In the PostProc tab define a shout when OK or NOTOK
- In the Shout Destination put "HOLD-JOB"
- In the Message put "%%ORDERID"

This workaround steps enable Control-M/Server to automatically HOLD in the AJF the job referenced by %%ORDERID when the status for this job is OK or NOTOK.
Best regards
Walty

User avatar
GrandSteph
Nouveau
Nouveau
Posts: 17
Joined: 24 Oct 2011 12:00

Post by GrandSteph » 29 Jan 2014 3:05

Ok Got that. Thanks.
Now, on Monday morning, I'll have all my jobs on hold from Friday night.

Chances are, I won't need to rerun any. SO my guess is that when the time for CM refresh comes, I have to execute a script that will remove all scripts on hold from the AJF. Would that work?

It's sounds heavy, but at least it's a valid option.

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 04 Feb 2014 7:51

GrandSteph,
We adressed this kind of issue in one of the major telephone company in France. Customer wanted to keep all jobs under control until a consistent set of job (here the management unit was the controlm APPLICATION name).
All jobs were defined with a MAXWAIT = 99n, which means that automatic cleanup of the AJF is not automaticamlly carried out and that the modification is to be done manually.
Of course, « manually » was not (and still is not) my concern. To address the issue, we created a standard script which updated the MAWXWAIT field on the AJF using a standar SQL request, like « updatre CMR_AJF set MAXWAIT=1 where APPLIC=’appli name’ and ODATE=’yyyymmdd’.
As a result, the jobs will be removed from AJF at the next newday procedure.
This update job was the very last one on the global application workflow.
Note that the update is not propagated on the EM GUI unless you hold/free the upddated jobs. However, the update is reflected on the controlm database ; you can check it using ctmpsmor SQL, and the AJF cleanup is based on the contents of the server database, not the EM one.

Cheers
Nicolas Mulot

User avatar
GrandSteph
Nouveau
Nouveau
Posts: 17
Joined: 24 Oct 2011 12:00

Post by GrandSteph » 04 Feb 2014 2:54

That is smart.

Thank you, will try that.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 05 Feb 2014 7:42

You can also see this topic
Best regards
Walty

Post Reply