Quantcast
Channel: Active questions tagged bmc - Stack Overflow
Viewing all articles
Browse latest Browse all 127

Control-M - analyze SQL Server output with On-Do Actions

$
0
0

We are using Control-M to submit several batch jobs to a legacy application, but due to limitations, the only way to monitor their status is by querying the Process table of the DB.

Process table:

JobNumJobStatBatch
1FinishedABC
2FailedABC
3StartedABC
4StartedABC

I am trying use Cyclic Database job to query the Jobs, and rerun ever 5min while there are still jobs in Started, but have it break when:

  • The query result is empty (No jobs exist for that batch) - set to Not OK
  • All jobs are in either Finished or Failed in the batch - set to OK

Currently, I am trying to do something like:

SELECT 'TotalJobs', COUNT(JobNum)FROM ProcessWHERE Batch = 'ABC'SELECT 'StartedJobs', COUNT(JobNum)FROM ProcessWHERE Batch = 'ABC'  AND JobStat = 'Started'SELECT 'CompletedJobs', COUNT(JobNum)FROM ProcessWHERE Batch = 'ABC'  AND JobStat IN ('Finished', 'Failed')

Then using On-Do Actions with Specific statements like -

Statement: *Code: TotalJob,0Set-NotOK
Statement: *Code: StartedJobs,0Set-OK

But it does both actions...

Is this possible to do this more complex analysis with On-Do Actions?

Thanks


Viewing all articles
Browse latest Browse all 127

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>