Page 1 of 1
Capturing Server JobStatus Variable
Posted: Thu Nov 08, 2007 9:57 am
by dtatem
Hello To All:
I have an After job server routine that captures jobs statistics, row counts etc. In this routine I have the following code
JobStatus = DSGetJobInfo(JobHandle, DSJ.JOBSTATUS)
The content of JobStatus is 0[zero] when we insert it into an ODS logging table when the job completes OK. Instead of JobStatus =0 or 1, I want to place some meaningful status ie "Complete"or "Failed" instead of 0 or 1. Therefore I have coded the following:
if JobStatus = 0 then
TheJobStatus ="Complete"
end
else
TheJobStatus ="Failed"
end
When I pass the variable "TheJobStatus" into my calling function which inserts the job status into the ODS table, nothing gets passed. Can you tell me what I am doing wrong and/or is there a better way of doing this?
Also is there a way to display the content of variable "TheJobStatus" or "JobStatus" for debugging purpose while testing?
Thanks In Advance for your help and ideas
--dtatem
Posted: Thu Nov 08, 2007 9:59 am
by chulett
Quick note - 'after job' the job is still running, so that's the only status you'll get. Check for the INTERIM status instead.
Re: Capturing Server JobStatus Variable
Posted: Thu Nov 08, 2007 10:08 am
by dtatem
Can you tell me what is the variable for "INTERIM" status
dtatem wrote:Hello To All:
I have an After job server routine that captures jobs statistics, row counts etc. In this routine I have the following code
JobStatus = DSGetJobInfo(JobHandle, DSJ.JOBSTATUS)
The content of JobStatus is 0[zero] when we insert it into an ODS logging table when the job completes OK. Instead of JobStatus =0 or 1, I want to place some meaningful status ie "Complete"or "Failed" instead of 0 or 1. Therefore I have coded the following:
if JobStatus = 0 then
TheJobStatus ="Complete"
end
else
TheJobStatus ="Failed"
end
When I pass the variable "TheJobStatus" into my calling function which inserts the job status into the ODS table, nothing gets passed. Can you tell me what I am doing wrong and/or is there a better way of doing this?
Also is there a way to display the content of variable "TheJobStatus" or "JobStatus" for debugging purpose while testing?
Thanks In Advance for your help and ideas
--dtatem
Re: Capturing Server JobStatus Variable
Posted: Thu Nov 08, 2007 10:11 am
by dtatem
I was a bit quick on the submit button..but I found the variable..
thanks
dtatem wrote:Can you tell me what is the variable for "INTERIM" status
dtatem wrote:Hello To All:
I have an After job server routine that captures jobs statistics, row counts etc. In this routine I have the following code
JobStatus = DSGetJobInfo(JobHandle, DSJ.JOBSTATUS)
The content of JobStatus is 0[zero] when we insert it into an ODS logging table when the job completes OK. Instead of JobStatus =0 or 1, I want to place some meaningful status ie "Complete"or "Failed" instead of 0 or 1. Therefore I have coded the following:
if JobStatus = 0 then
TheJobStatus ="Complete"
end
else
TheJobStatus ="Failed"
end
When I pass the variable "TheJobStatus" into my calling function which inserts the job status into the ODS table, nothing gets passed. Can you tell me what I am doing wrong and/or is there a better way of doing this?
Also is there a way to display the content of variable "TheJobStatus" or "JobStatus" for debugging purpose while testing?
Thanks In Advance for your help and ideas
--dtatem
Re: Capturing Server JobStatus Variable
Posted: Thu Nov 08, 2007 10:22 am
by dtatem
The JOBINTERIMSTATUS states the following:
DSJ.JOBINTERIMSTATUS. Returns the status of a job after it has run all stages and controlled jobs, but before it has attempted to run an after-job subroutine. (Designed to be used by an after-job subroutine to get the status of the current job)
My question is does it return 1 or 0 or someother value? if it returns "someothervalue" what is that value?
How do I display its content while debugging.
regards
-dtatem
dtatem wrote:Can you tell me what is the variable for "INTERIM" status
dtatem wrote:Hello To All:
I have an After job server routine that captures jobs statistics, row counts etc. In this routine I have the following code
JobStatus = DSGetJobInfo(JobHandle, DSJ.JOBSTATUS)
The content of JobStatus is 0[zero] when we insert it into an ODS logging table when the job completes OK. Instead of JobStatus =0 or 1, I want to place some meaningful status ie "Complete"or "Failed" instead of 0 or 1. Therefore I have coded the following:
if JobStatus = 0 then
TheJobStatus ="Complete"
end
else
TheJobStatus ="Failed"
end
When I pass the variable "TheJobStatus" into my calling function which inserts the job status into the ODS table, nothing gets passed. Can you tell me what I am doing wrong and/or is there a better way of doing this?
Also is there a way to display the content of variable "TheJobStatus" or "JobStatus" for debugging purpose while testing?
Thanks In Advance for your help and ideas
--dtatem
Posted: Thu Nov 08, 2007 10:28 am
by chulett
It returns the 'standard' status values as documented in the $DSHOME/include/dsapi.h file and elsewhere:
Code: Select all
/* 'jobStatus' values... */
#define DSJS_RUNNING 0 /* Job running */
#define DSJS_RUNOK 1 /* Job finished a normal run with no warnings */
#define DSJS_RUNWARN 2 /* Job finished a normal run with warnings */
#define DSJS_RUNFAILED 3 /* Job finished a normal run with a fatal error */
#define DSJS_VALOK 11 /* Job finished a validation run with no warnings */
#define DSJS_VALWARN 12 /* Job finished a validation run with warnings */
#define DSJS_VALFAILED 13 /* Job failed a validation run */
#define DSJS_RESET 21 /* Job finished a reset run */
#define DSJS_CRASHED 96 /* Job was stopped by some indeterminate action */
#define DSJS_STOPPED 97 /* Job was stopped by operator intervention (can't tell run type) */
#define DSJS_NOTRUNNABLE 98 /* Job has not been compiled */
#define DSJS_NOTRUNNING 99 /* Any other status */
Posted: Thu Nov 08, 2007 8:54 pm
by ray.wurlod
Interim status is the job status assuming that the after-job subroutine that calls it returns properly - without generating warnings or errors and with ErrorCode argument set to 0 - that is, the job status that would obtain if there were no after-job subroutine.