Compare job's sysout

Post Reply
User avatar
Dilbert
Nouveau
Nouveau
Posts: 185
Joined: 10 Jan 2007 12:00
Location: Zagreb, Croatia

Compare job's sysout

Post by Dilbert » 28 Jun 2008 7:33

Hello all,

How I can, using CONTROL-M 6.3.01 for Distributed Systems, compare results (sysout) of two jobs, and if the results are not equal, set the status of second job to NOTOK?
Is that possible on CTM for Distributed Systems? I know about CONTROL-M/Analyzer (it works only on z/OS), but how to achieve this without Analyzer, on DS side?

For example:
Job_A – in the sysout, we have result from SELECT query, and it says, for example, 62250.
Job_B – finished, and compare it's results (SELECT statement too) with Job_A, and if results are different, Job_B must finish with NOTOK status.

How to control job's flow using comparison between job's sysout?

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 30 Jun 2008 4:01

There isnt an utility that do exactly the sysout comparison, but you can do it with controlm instruments (steps), or building a control script.

User avatar
srinathk
Nouveau
Nouveau
Posts: 11
Joined: 01 May 2008 12:00

Post by srinathk » 03 Jul 2008 9:01

Can be done - If you are smart enough to use CMR_SYSOUT with sql/scripts. Good luck !!

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

Post by gglau » 04 Jul 2008 4:19

Can you do this:

JobA finishes, copy sysout to a directory with a staic name
JobB finishes, copy sysout to same directory with another static name
JobC waiting for conditions from JobA and JobB, with proper OS command to compare the two files, OK if same, NOTOK if different

User avatar
Dilbert
Nouveau
Nouveau
Posts: 185
Joined: 10 Jan 2007 12:00
Location: Zagreb, Croatia

Post by Dilbert » 15 Jul 2008 8:56

gglau wrote:Can you do this:

JobA finishes, copy sysout to a directory with a staic name
JobB finishes, copy sysout to same directory with another static name
JobC waiting for conditions from JobA and JobB, with proper OS command to compare the two files, OK if same, NOTOK if different
Well, this should work, but I'm not satisfied with that. The point is, if comparison failed, JobB must finish with NOTOK immediately - that's the solution customer wants. :(
It would be great to include that feature in next version, or include featire which will read something from sysout and pass that to another job, and then you can use Steps panel, On <some> /Do NOTOK....

User avatar
Lacoochee
Nouveau
Nouveau
Posts: 5
Joined: 25 Apr 2008 12:00
Location: San Antonio, FL

Post by Lacoochee » 15 Jul 2008 5:26

Well, if you want you could wrap both database procedures in the same ksh or perl script and then based on a comparison of the results from each call exit OK nor Not-OK. (exit 1 or 0)

OR

if the jobs need to be discrete execute the first database procedure and save the results (sysout) to a static file. Wrap the second call in a script, grab the initial results, execute the second call, compare the results and exit appropriately.

User avatar
Dilbert
Nouveau
Nouveau
Posts: 185
Joined: 10 Jan 2007 12:00
Location: Zagreb, Croatia

Post by Dilbert » 17 Jul 2008 8:30

Lacoochee wrote:Well, if you want you could wrap both database procedures in the same ksh or perl script and then based on a comparison of the results from each call exit OK nor Not-OK. (exit 1 or 0)
I thought about it, but first, I must talk with customer's developers to see if that solution is possible.
But, this can be a problem... every time they heard about changing scripts, they rolled their eyes. :) "A lot of works to do", "we expected that CONTROL-M support that out from the box", bla bla bla bla... :)

hipikll

Post by hipikll » 17 Jul 2008 9:28

There is a way, if the second job you run you can run as a command.
So for example:
jobA sysout > /tmp/Alog
jobB cmdline > '[execution of your script via cmd] > /tmp/Blog && diff /tmp/Alog /tmp/Blog

It's really clear way and easy to implement without any of obstacles :)
(diff returns 0 if files are identical and 1 if there is a difference)

Enjoy ;)

Uff, i feel again like a guru :-D

User avatar
Dilbert
Nouveau
Nouveau
Posts: 185
Joined: 10 Jan 2007 12:00
Location: Zagreb, Croatia

Post by Dilbert » 17 Jul 2008 12:21

Excellent solution, hipikll ! As always, the solution can be very simple, but someone must get into it. ;)

I will try that as soon as possible. I'm executing scripts using products from 3rd party developers (CONTROL-M AI for Databases), but this product can run scripts using cmdline, so I will try with that.

I must add... scripts is running on Windows machine, so I must use "comp" command instead of "diff", and i must specify number of lines where I expect results which I compare.

I hope this thread will be useful for others. :)

Post Reply