(DSOpenJob) Cannot open job - not a runnable job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

(DSOpenJob) Cannot open job - not a runnable job

Post by pmadhavi »

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.
Thanks,
Madhavi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Hi,

Monitor batch while runing...Check log from director.


Thanks,
Anupam
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

sb_akarmarkar wrote:Hi,

Monitor batch while runing...Check log from director.


Thanks,
Anupam
I compiled the job before running the batch.
But the batch is getting aborted for the same job.
and it is also giving the same error.
Thanks,
Madhavi
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

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
Thanks,
Madhavi
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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:

Code: Select all

ErrCode = DSSetParam(hJob7, "$PROJDEF", "$PROJDEF") 
lines look weird, that's not right. I don't know what's going on with that.
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
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

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?
Thanks,
Madhavi
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

pmadhavi wrote:Can you pls suggest me any setting has to be enabled for the batch?
None that I know.

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
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

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.
Thanks,
Madhavi
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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. :wink:
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
Post Reply