Hi,
I am trying to write a end job routine to populate a Oracle table with some job status lke start time, end time and job status.
I am finding some difficulty in obtaining the job status. It always returns '0' (running) at the end of the job.
JOB_STATUS = DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
However, I noticed that job status in the reports generated by DSJobReport is different?
Question:
1. Why is it different and how can I get the job status stated in DSJobReport?
Job completion status
Moderators: chulett, rschirm, roy
Tytoi,
as you are calling the end-of-job subroutine from within you job itself, it will always return the status of "running"; in order for this to work you need to get the status after it completes.
If you start and run your job from a sequence or from a Job Control, the status of the job will be available to you and you don't need to write your own Basic program.
as you are calling the end-of-job subroutine from within you job itself, it will always return the status of "running"; in order for this to work you need to get the status after it completes.
If you start and run your job from a sequence or from a Job Control, the status of the job will be available to you and you don't need to write your own Basic program.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read the help on DSGetJobInfo - there is a different argument (new in version 7.x??) that allows you to demand the interim status (that is, the status as if the job had already finished).
The reason DSJobReport is different is that it is actually executed after the job has finished.
The reason DSJobReport is different is that it is actually executed after the job has finished.
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.
Thanks guys for all your help.
I found the command to get the interim status DSGetJobInfo(JobHandle,DSJ.JOBINTERIMSTATUS).
One more question, are the return codes from DSJ.JOBINTERIMSTATUS the same as DSJ.JOBSTATUS? I can't seem to find the return codes for DSJ.JOBINTERIMSTATUS in JOBCONTROL.H or am I looking in the wrong place?
Thanks again
TY
I found the command to get the interim status DSGetJobInfo(JobHandle,DSJ.JOBINTERIMSTATUS).
One more question, are the return codes from DSJ.JOBINTERIMSTATUS the same as DSJ.JOBSTATUS? I can't seem to find the return codes for DSJ.JOBINTERIMSTATUS in JOBCONTROL.H or am I looking in the wrong place?
Thanks again
TY
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The status codes are the same as for DSGetJobInfo(hJob, DSJ.JOBSTATUS). They are represented by the constants whose names begin with "DSJS." and which can be found in JOBCONTROL.H.
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.
</a>