Page 1 of 1

Prob lem running UNIX script for a DataStage job

Posted: Tue Sep 18, 2007 9:42 pm
by lsnovick
I have a unix script that calls a DataStage job. this job runs fine when it runs on it's own. I know the script is good because it runs other jobs fine. Here is the error when the script calls the job:

Error running job

Status code = -2 DSJE_BADSTATE.

Not much to go on. Anyone see this problem before?

Re: Prob lem running UNIX script for a DataStage job

Posted: Tue Sep 18, 2007 10:09 pm
by kwwilliams
It looks like you job needs to be in a runnable state when the script attempts to execute the job. You could catch this error and attempt to reset the job if it is in a bad state.

Posted: Tue Sep 18, 2007 10:52 pm
by Raghavendra
Status code = -2 DSJE_BADSTATE.
will be thrown usually when a job is not in a runnable state.You can compile the job and can run the screipt again.

As a usual practice we used to reset the job in the script only.

Posted: Wed Sep 19, 2007 1:09 am
by ray.wurlod
"Not in a runnable state" includes "already running". Check that you don't have the script trying to start the same job twice, or two scripts trying to start the same job at similar times.

Otherwise check that the job status is one of "finished", "finished (see log)", "validated", "validated (see log)", "compiled" or "has been reset". These are the only status values that indicate that the job is in a runnable state.