Using "AND" on DO STATMENT ?

All questions about Control-M jobs definitions
Post Reply
User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Using "AND" on DO STATMENT ?

Post by csaliou » 12 Dec 2007 11:40

Hello, I am new here !

I would like to know if it is possible (and how) to use a 'AND' in DO Statment.

In STEP, my ON OK condition should meet 2 conditions :
- My JOB exists with a COMPLETED statment
ON Statment (Stm = *) Code = (COMPLETED)
- My job exists with a code < 5
ON Statment (Stm = *) Code = (COMPSTAT < 5)

But I am not able to use BOTH of these conditions.
CTM will ended with a SUCCESS on one of these conditions fullfilled.

Any help ?

Thanks,
Cédric from Paris, France

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 12 Dec 2007 1:13

to anderstand how control-m work on completion statements and codes, you must read Control-m Job Parameter and Variable Reference guide, on www.bmc.com site.
pages : 256 / 257 / 258 ...

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 12 Dec 2007 1:33

That documentation is available on scheduler-usage too.
Use left module docs when you are connected

User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Post by csaliou » 12 Dec 2007 2:34

philmalmaison wrote:to anderstand how control-m work on completion statements and codes, you must read Control-m Job Parameter and Variable Reference guide, on www.bmc.com site.
pages : 256 / 257 / 258 ...
I already read this documentation.
I forgot to say that I am not in z/OS, but in Unix (AiX).
There is no AND or OR conditions between STEP statments...

We are migrating CTM from MVS to Unix.
That is the problem. Indeed in MVS return codes < 5 are OK, not in Unix !
Dont really know how to handle this.

Perhaps, we can echo "COMPLETED RETURN_CODE=XXXXX", and if we are able to catch this RETURN_CODE to a CTM global var, it should be easy to create conditions for OK or NOTOK.

The fact is, at this point, we are even able to make the difference between a return code of 1 issued from CTM (for exemple, if the script to execute is not found) or issued from the end of the script.

Any idea ?
Thanks

User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Post by csaliou » 12 Dec 2007 2:35

fyot wrote:That documentation is available on scheduler-usage too.
Use left module docs when you are connected
Read... No clue to achieve our goal...

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 12 Dec 2007 2:42

Hi csaliou

AND operator doesn't exist with the ON STATMENT.
In fact, each time you add a new ON STATEMENT test, it's as a new test condition with OR operator.
The first ON STAMENT only, is automatically declared with AND.

To see operators, you must orde you job et see STEPS propreties.

User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Post by csaliou » 12 Dec 2007 2:53

Ok but we still have the problem of the RETURN_CODE < 5.

Can you help me to catch the value of the SYSOUT following line :

"COMPLETED RETURN_CODE=XXXX"

How can I assign a global variable in CTM with the value XXXX ?

Thanks

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 12 Dec 2007 3:05

I will advise to you to review your unix script.

You must try your test directly in your script and send the correct exit code need to continue your treatment.

Or you can add in your script a command to add value in a AUTOEDIT variable unsing SETVAR utility, presents on each Control-M Agent.

User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Post by csaliou » 12 Dec 2007 3:32

I will give this a try (we cant modify return code, but I can send the exit code to CTM).

See you

Juressen
Nouveau
Nouveau
Posts: 23
Joined: 18 May 2006 12:00
Location: Schiphol-Rijk

Post by Juressen » 17 Dec 2007 12:33

Csaliou,

You mention:
We are migrating CTM from MVS to Unix.
That is the problem. Indeed in MVS return codes < 5 are OK, not in Unix !

If this means that there will be no more jobs running on MVS, then you do not need to consider the MVS "only" default (return codes until 4 are OK).

But I don't think that's your case.
If you install Control-M software on UNIX, this implies generally that you will be installing Control-EM (Enterprise Manager) and Control-M server software. The Control-M EM software enables you to graphically see what the batch flows are. It has gateways to the Control-M server software on UNIX systems, AND on MVS systems. The Control-M software on MVS still needs to be installed on MVS.

Now: the templates used for UNIX schedule definitions differs from the tempates used for MVS schedule definitions.
So once you have installed the Control-M software on UNIX, you need to define the gateway to MVS (on UNIX), and on MVS you need to install the so called IOAGATE.
If this is all in place then you probably see the MVS templates and there you will see that you still have the AND/OR possibility.

User avatar
csaliou
Nouveau
Nouveau
Posts: 7
Joined: 10 Dec 2007 12:00

Post by csaliou » 17 Dec 2007 5:46

Hi Juressen,

The problem is that we are not working on client environment, but on a test plateform.
So we dont have any access to the MVS Control M...
We just have the whole XML file from the Control M database...

Thanks for tip anyway...

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 20 Dec 2007 2:55

why don't you use something like

on statment = * Code = "COMPLETED RETURN_CODE=XXXXX"
do something ?

regards
Philmalmaison

Post Reply