Page 1 of 1
Job completion status
Posted: Mon Jun 06, 2005 3:32 am
by tytoi
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?
Posted: Mon Jun 06, 2005 3:47 am
by ArndW
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.
Posted: Mon Jun 06, 2005 2:59 pm
by ray.wurlod
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.
Posted: Mon Jun 06, 2005 9:06 pm
by tytoi
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
Posted: Tue Jun 07, 2005 12:13 am
by ArndW
Ray - thanks for the heads-up!!!! I knew there was a reason for actually referring to the documentation but couldn't remember it

Posted: Tue Jun 07, 2005 2:44 am
by ray.wurlod
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.