(DSOpenJob) Cannot open job - not a runnable job
Moderators: chulett, rschirm, roy
(DSOpenJob) Cannot open job - not a runnable job
Hi,
I created batches of 10jobs each in the Director.
I am able to run all the batches except one batch.
And when I opened the batch log, for one of the jobs i got the following error message.
Batch::Setup2_1C..JobControl (fatal error from DSAttachJob): Job control fatal error (-12)
(DSOpenJob) Cannot open job XYZ. - not a runnable job
I compiled the job and ran it individually.
It is running fine.
But only when ran in the batch its giving the error.
Do I have to run the REINDEX command?
Please suggest me how to proceed.
I created batches of 10jobs each in the Director.
I am able to run all the batches except one batch.
And when I opened the batch log, for one of the jobs i got the following error message.
Batch::Setup2_1C..JobControl (fatal error from DSAttachJob): Job control fatal error (-12)
(DSOpenJob) Cannot open job XYZ. - not a runnable job
I compiled the job and ran it individually.
It is running fine.
But only when ran in the batch its giving the error.
Do I have to run the REINDEX command?
Please suggest me how to proceed.
Thanks,
Madhavi
Madhavi
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Verify that the job is in a runnable state just before running the batch.
Check the job log for job XYZ both before and after running the batch.
Post your results.
Check the job log for job XYZ both before and after running the batch.
Post your results.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 232
- Joined: Fri Sep 30, 2005 4:52 am
- Contact:
Verify the case sensitive job name is correct. Then, create a new Batch job from Director and use the Add Jobs functionality to add the job to that new Batch. Run that test Batch job and see if it works. If it does, then go back to your original Batch job and find the discrepancy and let us know your resolution. If it doesn't work, let us know and we'll help further.
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
When I add the job to the Director, The code getting added is as follows:
Setup XYZ, run it, wait for it to finish, and test for success
hJob8 = DSAttachJob("XYZ", DSJ.ERRFATAL)
If NOT(hJob8) Then
Call DSLogFatal("Job Attach Failed: XYZ", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob8, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob8)
Status = DSGetJobInfo(hJob8, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: XYZ", "JobControl")
End
but for all other jobs the code looks like
Setup ABC, run it, wait for it to finish, and test for success
hJob7 = DSAttachJob("ABC", DSJ.ERRFATAL)
If NOT(hJob7) Then
Call DSLogFatal("Job Attach Failed: ABC", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$v", "$PROJDEF")
ErrCode = DSSetDisableProjectHandler(hJob7, @FALSE)
ErrCode = DSSetDisableJobHandler(hJob7, @FALSE)
ErrCode = DSRunJob(hJob7, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob7)
Status = DSGetJobInfo(hJob7, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: ABC", "JobControl")
End
Setup XYZ, run it, wait for it to finish, and test for success
hJob8 = DSAttachJob("XYZ", DSJ.ERRFATAL)
If NOT(hJob8) Then
Call DSLogFatal("Job Attach Failed: XYZ", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob8, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob8)
Status = DSGetJobInfo(hJob8, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: XYZ", "JobControl")
End
but for all other jobs the code looks like
Setup ABC, run it, wait for it to finish, and test for success
hJob7 = DSAttachJob("ABC", DSJ.ERRFATAL)
If NOT(hJob7) Then
Call DSLogFatal("Job Attach Failed: ABC", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
ErrCode = DSSetParam(hJob7, "$v", "$PROJDEF")
ErrCode = DSSetDisableProjectHandler(hJob7, @FALSE)
ErrCode = DSSetDisableJobHandler(hJob7, @FALSE)
ErrCode = DSRunJob(hJob7, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob7)
Status = DSGetJobInfo(hJob7, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: ABC", "JobControl")
End
Thanks,
Madhavi
Madhavi
Okay, but run the Batch job that just runs XYZ. Does it work? If it does, then your problem is your original Batch job logic.
All of those:
lines look weird, that's not right. I don't know what's going on with that.
All of those:
Code: Select all
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
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
I created a new batch with only XYZ job. It s giving the same error.
In normal scenario, when we add jobs to a batch, it will generate a line as givien below for all the parameters used in the job.
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
where as it not generating in case of the job XYZ which is having the issue.
The issue "(DSOpenJob) Cannot open job XYZ. - not a runnable job" is still there.
Can you pls suggest me any setting has to be enabled for the batch?
In normal scenario, when we add jobs to a batch, it will generate a line as givien below for all the parameters used in the job.
ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF")
where as it not generating in case of the job XYZ which is having the issue.
The issue "(DSOpenJob) Cannot open job XYZ. - not a runnable job" is still there.
Can you pls suggest me any setting has to be enabled for the batch?
Thanks,
Madhavi
Madhavi
None that I know.pmadhavi wrote:Can you pls suggest me any setting has to be enabled for the batch?
The problem is now your job. If the job cannot be attached, that means something else is preventing the DSAttachJob API from securing the job. The DS BASIC manual doesn't tell why a job can't be attached other than to state only one controlling process may have a particular job attached. This suggests the job is attached.
You state the job is compiled and you've run it. While not a perfect solution, exporting a job and then reimporting can clear away any issues with the job. We could go thru the steps of cleaning up resources, clearing the status file, etc, or just get them all at once with an export/import cycle. Try that and see if the job is okay with your test Batch job running it.
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
I found the strange behavior of DS Director.
I changed the job name and compiled it.
i created a new batch for the new job alone.
and it is working fine.
It happened with one other job also. I did the same for that job i.e renaming
and it is working fine.
But I dont understand what's wrong with the job name.
I changed the job name and compiled it.
i created a new batch for the new job alone.
and it is working fine.
It happened with one other job also. I did the same for that job i.e renaming
and it is working fine.
But I dont understand what's wrong with the job name.
Thanks,
Madhavi
Madhavi
I really didn't think XYZ was your jobname, and was hoping you didn't have a disallowed jobname. I didn't push the point of you changing the name, I "trusted" that you didn't use reserved characters.
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