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?
Compare job's sysout
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.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
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....
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.
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.
I thought about it, but first, I must talk with customer's developers to see if that solution is possible.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)
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...
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
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
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.
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.