Error calling DSRunJob

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
lory
Participant
Posts: 21
Joined: Tue Apr 13, 2004 9:05 am

Error calling DSRunJob

Post by lory »

I have written a routine to call a shell unix using DSRunJob function.

the Routine (and the job that is called from it) runs unsuccessfully the first time. The error I
see is(***Controller problem: Error calling DSRunJob(.....), code=-2
[Job is not in the right state (compiled and not running)]***) .

I was wondering if any of you guys came across this problem??


Thank You!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Error calling DSRunJob

Post by chulett »

lory wrote:I have written a routine to call a shell unix using DSRunJob function.
Welcome aboard! :D

If you are trying to execute a shell script - no matter what the shell script does - you need to use DSExecute instead. Only use DSRunJob to start a DataStage job (typically) from within Job Control, and then only after attaching to it ('DSAttachJob') and possibly resetting it first ('DSPrepareJob'). Depending on your circumstances, you may need to detach the job handle when you are done as well, and that's 'DSDetachJob' from what I recall.

Inside your shell script, you would use dsjob to start the DataStage job from the Command Line.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply