Hi !
I have a job control which failed with the message below :
[i]DTMCtrlFaitSCMMens..JobControl (fatal error from DSRunJob): Job control fatal error (-2)
(DSRunJob) Job DTMAlimNBOS is not in a runnable state[/i]
When i check the DTMAlimNBOS job, it's correctly compiled and the job have [b][u]Run[/u][/b] !!! :shock:
here a piece of the job control code :
* Setup DTMAlimNBOS, run it, wait for it to finish, and test for success
hJob3 = DSAttachJob("DTMAlimNBOS", DSJ.ERRFATAL)
If NOT(hJob3) Then
Call DSLogFatal("Job Attach Failed: DTMAlimNBOS", "JobControl")
Abort
End
LimitErr= DSSetJobLimit(hJob3,DSJ.LIMITWARN,MaxWarning)
ErrCode = DSSetParam(hJob3, "dsn_cible", dsn_DTM)
ErrCode = DSSetParam(hJob3, "usr_cible", usr_DTM)
ErrCode = DSSetParam(hJob3, "pwd_cible", pwd_DTM)
ErrCode = DSSetParam(hJob3, "dsn_source", dsn_DWH)
ErrCode = DSSetParam(hJob3, "usr_source", usr_DWH)
ErrCode = DSSetParam(hJob3, "pwd_source", pwd_DWH)
ErrCode = DSRunJob(hJob3, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob3)
Status = DSGetJobInfo(hJob3, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: DTMAlimNBOS", "JobControl")
End
If Status = DSJS.RUNWARN Then
Call DSLogWarn("Job Warning : DTMAlimNBOS" ,"JobControl")
End
Any Idea ?
thanks a lot
Fred
Job Control Aborting with "Job is not a runnable state&
Moderators: chulett, rschirm, roy
instead
Try with
Code: Select all
ErrCode = DSRunJob(hJob3, DSJ.RUNNORMAL)
Code: Select all
ErrCode = DSRunJob(hJob3, DSJ.RUNRESET)
Success consists of getting up just one more time than you fall.
Doing that would only reset the job, not reset it and then run it. If you want to emulate the 'Reset if required then run' functionality of a Sequence job, you need to do both.
And if you want to do it 'right', check the status of the job and only issue the RUNRESET if you need to.![Wink :wink:](./images/smilies/icon_wink.gif)
And if you want to do it 'right', check the status of the job and only issue the RUNRESET if you need to.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
As noted, your code seems to be 'fine', being pretty much exactly what DataStage generates when you use the 'Add Job' button.
That being said, this kind of problem is just usually a timing problem. Some other process (or person) ran the job and when this one tried to you got the dreaded 'job is not in a runnable state' message - because it was already running!![Wink :wink:](./images/smilies/icon_wink.gif)
That being said, this kind of problem is just usually a timing problem. Some other process (or person) ran the job and when this one tried to you got the dreaded 'job is not in a runnable state' message - because it was already running!
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers