Hi
I put the following script inside the JOB control of a job. I want it to stop when the parameter RE_PLAY='N'.
IF RE_PLAY="N"
THEN
ErrCode = DSStopJob(DSJ.ME)
IF ErrCode=0
THEN
Call DSLogInfo("Job stopped because input file empty", "Job control")
END
ELSE
Call DSLogWarn("Error Stopping", "Job control")
END
END
But the DSDtopJob is not executiong perfectly, and the value of ErrCode=DSJE.BADHANDLE. For other functions DSJ.ME is working OK ... Please help... why datastage is showing such weird behaviour?
Regards
rubu
DSStopJob(DSJ.ME) is failing in JOB CONTROL
Moderators: chulett, rschirm, roy
The DSStopJob function is designed to stop jobs that are controlled by the current one, not for the job itself. If you wish to stop your own job from within the Job Control you could issue a call to DSLogFatal('Your message','ProgramName'). This call does not return and set the status of the job to ABORTed. If you wish to finish the job without any errors then I am not sure what to do, since issuing an explicit STOP command leaves the director thinking that the job is still running. I would then recommend to put this logic one level higher, i.e. writing a sequence or job which then calls the actual processing job depending on the outcome of a condition.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Just use DSLogFatal to abort a job by writing a RED message to the job log. That will leave the job in an unusable state, just the same as if another job issued the STOP call.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle