I am trying to set a special JobStatus for jobs which reject rows based on certain business rules. The job is invoked using dsjob run from a third party scheduler and support needs to know when this situation occurs.
I am using a Transform Routine invoked in a derivation of a Reject link.
If we get any rejects then I need to set the JobStatus to something other than 0 or 1 or 2 (ie. 3 or 4 or 5...).
I'm away from a DS installation (and documentation), but I think there is another code in the DSGetJobInfo() call for the User status vs. the job status.
I believe that would be 'DSJ.USERSTATUS' but that's not what I'm after.
I want to force the JOB status not the UserStatus so that the third party controlling tool gets a different return code from the unix script that runs dsjob.
You don't get any mechanism for altering the job status apart from DSLogWarn and DSLogFatal, and setting the ErrorCode argument of a before/after subroutine to a value of other than 0. All of these except DSLogWarn cause the status to be 3; DSLogWarn causes the status to be 2 unless the job aborts for some other reason.
That's why user status is there. It's yours. Job status isn't: it's theirs.
The only other choice you might have is DSStopJob(DSJ.ME), which will change the status to DSJS.STOPPED - not, I suspect, your desired outcome.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi,
AFAIK,
Using dsjob will result in more info then just the user status.
Download Ken's kshell script from ADN and apply your changes if needed.
Basicly it outputs the stdout & stderr to a file and sample the file to gain whatever data you need.
I implemented such a script to function as a ^M DS jobs launcher utility.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
I suppose I should have taken a step back and not gone into solutions mode
So now I'm running a sequence using DSJOB but I've changed a UserStatus of a job within that sequence. If I use the -userstatus option I pressume I'll get the UserStatus of the sequence and not the job? Is this correct? If so, I should use something like a DSJOBINFO from the unix script? Is there such a command? I've been looking through the doco but can't remember where it's located!
Thanks for everyone's input. Nothing like being a little rusty and then getting thrown in the deep end!