Adding conditions by script or command line

Tools and several solutions to manage Control-M products
Post Reply
User avatar
eche1984
Nouveau
Nouveau
Posts: 44
Joined: 28 Apr 2009 12:00
Location: Buenos Aires, Argentina

Adding conditions by script or command line

Post by eche1984 » 06 Oct 2011 7:46

Hi all!!

I have a batch job that has to wait many conditions from some other batch jobs, but not all of them are executed along the week.

Something like this... I have job E that runs every day and waits conditions from jobs A, B, C and D. Today only executes job C and jobs A, B & D not because they don't have to. Tomorrow may execute jobs A & D but not jobs B & C.

Assuming that I can found which are the jobs that doesn't run today, does anybody know how I can add automatically the conditions of those jobs?

Regards,
eche

User avatar
philhaut
Nouveau
Nouveau
Posts: 32
Joined: 06 Feb 2007 12:00
Location: VALENCIENNES

Post by philhaut » 07 Oct 2011 9:49

hi
2 solutions
1) by script

you must check if the job A B C ... are in the AJF

ex on unix
PREJO=`ctmpsm -LISTGROUP "*" group name |grep CMD`
#test if PREJ0 has no result
if [ -z ${PREJO} ]
ctmcontb -ADD condition-name ODAT;
else
echo "no conditions to add"
fi

2) all jobs are in the same table and use adjust condition

User avatar
eche1984
Nouveau
Nouveau
Posts: 44
Joined: 28 Apr 2009 12:00
Location: Buenos Aires, Argentina

Post by eche1984 » 07 Oct 2011 3:24

thanks for replying.

i like option 1 and i'll probably implement it.

but i would like to know what is about "adjust condition"?

User avatar
philhaut
Nouveau
Nouveau
Posts: 32
Joined: 06 Feb 2007 12:00
Location: VALENCIENNES

Post by philhaut » 07 Oct 2011 3:42

Indicates whether to ignore prerequisite conditions normally set by predecessor jobs
if the relevant predecessor jobs are not scheduled.

This parameter is relevant only for SMART Tables (7.0). or Tables (6.3..)
ex

job D wait condition for job A B C and B is not scheduled ==> the condition between B and D is ignored

in the form Executuion for a table select adjust condition

User avatar
Jean-Mi
Nouveau
Nouveau
Posts: 19
Joined: 08 Sep 2006 12:00
Contact:

Post by Jean-Mi » 14 Oct 2011 8:55

Hi,

you can also use the "ctmldnrs" tool to manage the maybe conditions.
See the Administrator Guide for more information.

BR
Jean-Michel.

User avatar
eche1984
Nouveau
Nouveau
Posts: 44
Joined: 28 Apr 2009 12:00
Location: Buenos Aires, Argentina

Post by eche1984 » 14 Oct 2011 7:37

Thanks for your replies.

I finally made a Shell Script to solve this.

Post Reply