Warning log capture
Moderators: chulett, rschirm, roy
Warning log capture
Hi Gurus,
We have around 1000 jobs running every night.
Usually when job fails/aborts (threshold is 1 warning) ..on call person fix it and rerun the job so the entry is there in job log but its not for the last run.
we thought of automating it and designed the job which picks up all the jobs finished with warnings but this do not work in our scenario as oncall person at night has fixed the job and reran it so this job will not pickup the job finished with warnings.
Is there is any method to capture all jobs finished with warnings after the nightly cycle is finished(nightly cycle will only finish when all jobs are finished ok without warning) but we want to capture the jobs which actually got fixed or errored out at night.
Thanks,
We have around 1000 jobs running every night.
Usually when job fails/aborts (threshold is 1 warning) ..on call person fix it and rerun the job so the entry is there in job log but its not for the last run.
we thought of automating it and designed the job which picks up all the jobs finished with warnings but this do not work in our scenario as oncall person at night has fixed the job and reran it so this job will not pickup the job finished with warnings.
Is there is any method to capture all jobs finished with warnings after the nightly cycle is finished(nightly cycle will only finish when all jobs are finished ok without warning) but we want to capture the jobs which actually got fixed or errored out at night.
Thanks,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Open Director, and uncheck Show Categories in the View menu. Then click on the heading of the Status column. Jobs will be sorted by status; Aborted will be at the top.
To automate this process you will need to create a routine that iterates through all the jobs and selects those with the particular job status in question if the run date is within the previous 24 hours.
To automate this process you will need to create a routine that iterates through all the jobs and selects those with the particular job status in question if the run date is within the previous 24 hours.
Code: Select all
FUNCTION BadJobRuns(IgnoreMe)
* Returns comma-delimited list of job names with exit status Warnings or Abort.
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
Ans = ""
Open "DS_JOBS" To fDSJobs
Then
Select fDSJobs To 9
Loop
While ReadNext JobName From 9
If JobName Matches "1A0X"
Then
hJob = DSAttachJob(JobName, DSJ.ERRNONE)
JobStatus = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
If JobStatus = DSJS.RUNWARN Or JobStatus = DSJS.RUNFAILED
Then
Ans<-1> = JobName ; * add to dynamic array of names
End
ErrCode = DSDetachJob(hJob)
End
Repeat
Convert @FM To "," In Ans
Close fDSJobs
End
RETURN(Ans)
Last edited by ray.wurlod on Thu Mar 01, 2007 8:31 pm, edited 2 times in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,
As per your suggestion I created the routine but...
Its giving me below error , I have argument defined as IgnoreMe and routine name is BadJobRuns
Compiling: Source = 'DSU_BP/DSU.BadJobRuns', Object = 'DSU_BP.O/DSU.BadJobRuns'
*******************************************
WARNING: Variable 'DSJobs' never assigned a value.
WARNING: Variable 'DSJS.RUNFAIL' never assigned a value.
As in routine code provided by you its
Open "DS_JOBS" To fDSJobs
and
If JobStatus = DSJS.RUNWARN Or JobStatus = DSJS.RUNFAIL
We are on 7.1 Unix box.
Regards,
As per your suggestion I created the routine but...
Its giving me below error , I have argument defined as IgnoreMe and routine name is BadJobRuns
Compiling: Source = 'DSU_BP/DSU.BadJobRuns', Object = 'DSU_BP.O/DSU.BadJobRuns'
*******************************************
WARNING: Variable 'DSJobs' never assigned a value.
WARNING: Variable 'DSJS.RUNFAIL' never assigned a value.
As in routine code provided by you its
Open "DS_JOBS" To fDSJobs
and
If JobStatus = DSJS.RUNWARN Or JobStatus = DSJS.RUNFAIL
We are on 7.1 Unix box.
Regards,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
[quote="ray.wurlod"]Open Director, and uncheck Show Categories in the View menu. Then click on the heading of the Status column. Jobs will be sorted by status; Aborted will be at the top.
To automate this process you will need to create a routine that iterates through all the jobs and selects those with the particular job status in question if the run date is within the previous 24 hours.]
Hi,
We have created the routine it picks up the job finished with warnings or abort but if at night time oncall person fixes the job and run it succesfully then routine do not picks up that job. Actually we wanted to identify which job gave the problem even it was fixed at night and ran succesfully after the abort.
Regards,
Munish
To automate this process you will need to create a routine that iterates through all the jobs and selects those with the particular job status in question if the run date is within the previous 24 hours.]
Hi,
We have created the routine it picks up the job finished with warnings or abort but if at night time oncall person fixes the job and run it succesfully then routine do not picks up that job. Actually we wanted to identify which job gave the problem even it was fixed at night and ran succesfully after the abort.
Regards,
Munish
Sorry but just want to know Shrey that the routine is "After Job Sub-routine" i.e a shell script ? And how you get the info of all job's status ?
I mean what exactly you do ? You run the sequencer and scan all the jobs which are in the sequencer and then report the failed job or what ?
Sorry too many questions ? Just curious...
I mean what exactly you do ? You run the sequencer and scan all the jobs which are in the sequencer and then report the failed job or what ?
Sorry too many questions ? Just curious...
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
[quote="ganesh123"]Sorry but just want to know Shrey that the routine is "After Job Sub-routine" i.e a shell script ? And how you get the info of all job's status ?
I mean what exactly you do ? You run the sequencer and scan all the jobs which are in the sequencer and then report the failed job or what ?}
The routine is transform function , we are trying to capture name of all jobs which has filed/ warning for the nightly batch cycle but the code provided by Ray it does captures all the jobs which are still in warning/ aborted stage but our problem is we want to capture the names of jobs which even was corrected by oncall person at night and was ran succesffuly but they did fail first time during the nightly batch cycle.
thanks
I mean what exactly you do ? You run the sequencer and scan all the jobs which are in the sequencer and then report the failed job or what ?}
The routine is transform function , we are trying to capture name of all jobs which has filed/ warning for the nightly batch cycle but the code provided by Ray it does captures all the jobs which are still in warning/ aborted stage but our problem is we want to capture the names of jobs which even was corrected by oncall person at night and was ran succesffuly but they did fail first time during the nightly batch cycle.
thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A job's status is always its current status. That's all you mentioned in your specification.
To get previous status requires going to the job log, even assuming that you don't have auto-purge up to previous 1 job run enabled. It would be substantially different code.
To get previous status requires going to the job log, even assuming that you don't have auto-purge up to previous 1 job run enabled. It would be substantially different code.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,ray.wurlod wrote:A job's status is always its current status. That's all you mentioned in your specification.
To get previous status requires going to the job log, even assuming that you don't have auto-purge up to previous 1 job run enabled. It would be substantially different code.
Sorry for the confusion!. We can set the autopurge log to keep last 3 run entries or whatever you suggest but our aim to is to grab the job names which finished or aborted for the last run even though they were restarted again and ran succesfully....its usually a if job fails we fix and it runs succesfully for the subsequent run.
Regards
Shrey can you please elaborate, what did you do so far ? I am really interested in your topic but cannot proceed. Like what are the stages you using and how you grab the input and all ? I mean exactly from start in detail please.
It would be helpful to others too. I would really appreciate that.
It would be helpful to others too. I would really appreciate that.
If women didn't exist, all the money in the world would have no meaning.
-- Aristotle Onassis
-- Aristotle Onassis
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Algorithm design:
Find current status. If "Finished OK" then do the remainder.
Find start of current run.
Find newest "job finished" message prior to that timestamp.
Get status from that event.
Find current status. If "Finished OK" then do the remainder.
Find start of current run.
Find newest "job finished" message prior to that timestamp.
Get status from that event.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi Ray,ray.wurlod wrote:Algorithm design:
Find current status. If "Finished OK" then do the remainder.
Find start of current run.
Find newest "job finished" message prior to that timestamp.
Get status from that event.
Tried for 4 hours but seems my skills of playing with DS commands are lil weak so no luck till now.
Regards,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Algorithm design:
Find current status (DSGetJobInfo(hJob, DSJ.JOBSTATUS)). If "Finished OK" (DSJS.RUNOK) then do the remainder.
Find start of current run (DSGetJobInfo(hJob,DSJ.JOBSTARTTIMESTAMP)).
Find newest "job finished" message prior to that timestamp (EventNo = DSGetNewestLogId(hJob,...)).
Get status from that event (DSGetLogEvent(hJob, EventNo)).
Find current status (DSGetJobInfo(hJob, DSJ.JOBSTATUS)). If "Finished OK" (DSJS.RUNOK) then do the remainder.
Find start of current run (DSGetJobInfo(hJob,DSJ.JOBSTARTTIMESTAMP)).
Find newest "job finished" message prior to that timestamp (EventNo = DSGetNewestLogId(hJob,...)).
Get status from that event (DSGetLogEvent(hJob, EventNo)).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 73
- Joined: Wed Jun 28, 2006 3:27 pm
- Location: NJ