Start Loop in DS7.1

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

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Show me the syntax of your UtilityRunJob(). Just copy paste the derivation for me.
Also, i just tested your scenario out, it works perfectly fine for me.
Also go into the job log of your Sequence job and check out its status in the last run. After the first run, somehow its not in a runnable state.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

pmadhavi wrote:I diasabled the mutli instance option long back. Only for the first value of the csv file, the job is running successfully. But for 2nd onwards, it is showing the following warning in the main job:
<jobname>..Transformer_0 (DSRunJob): Job control error (-2)
(DSRunJob) Job <sequencejob> is not in a runnable state
Three pages now, eh? Hope they can afford the bill when it comes due. :wink: :wink:

Guessing here that with the multi-instance option 'disabled long back' the job is not in a runnable state because it is still running from the first value's launch.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B wrote:Show me the syntax of your UtilityRunJob(). Just copy paste the derivation for me.
Also, i just tested your scenario out, it works perfectly fine for me.
Also go into the job log of your Sequence job and check out its status in the last run. After the first run, somehow its not in a runnable state.
Please find the below code in the routine which is calling the sequence job.

$INCLUDE DSINCLUDE JOBCONTROL.H
JobHandle1 = DSAttachJob (<jobname>, DSJ.ERRWARN)
ParamName="Number"

ParamValue=Arg1

DsErrCode = DSSetParam(JobHandle1, ParamName, ParamValue)
ErrCode = DSRunJob(JobHandle1 , DSJ.RUNNORMAL)
Result = DSGetJobInfo (JobHandle1, DSJ.JOBSTATUS )
ErrCode1 = DSDetachJob(JobHandle1)

if DsErrCode=0 then Ans=Result
else Ans=Result
--------------------------------------
please find the log of the sequence below:
there's no warnings; its runnign fine and it is showing the log for the first value from the csv.

TestInvocation..JobControl (@Coordinator): Summary of sequence run
13:44:34: Sequence started
13:44:34: Job_Activity_0 (JOB <job1>) started
13:44:38: Job_Activity_0 finished, status=1 [Finished OK]
13:44:39: Job_Activity_1 (JOB <job2>) started
13:44:45: Job_Activity_1 finished, status=1 [Finished OK]
13:44:47: Job_Activity_5 (JOB <job3>) started
13:44:49: Job_Activity_5 finished, status=1 [Finished OK]
13:44:49: Sequence finished OK
(Mainjob) <- TestInvocation: Job under control finished.
-------------------------------------------

And i am using DSRunJob routine instead of Utilityjobrun.
Thanks,
Madhavi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ummm... where's the 'Wait for the job to complete' part? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Specifically, you can't check for status until it has completed. Well, you can but you won't get what you are thinking you are getting.

Code: Select all

DsErrCode = DSSetParam(JobHandle1, ParamName, ParamValue) 
ErrCode = DSRunJob(JobHandle1, DSJ.RUNNORMAL) 
ErrCode = DSWaitForJob(JobHandle1)
Result = DSGetJobInfo(JobHandle1, DSJ.JOBSTATUS) 
ErrCode1 = DSDetachJob(JobHandle1)
Which means your error *is* because it was still running, hence not in a 'runable' status...
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Bingo, Craig is the saviour of the day.
So you were using DSJobRun() huh? And all this while i was under the impression that you were using the Utility. Because the utility is smart enough to wait for the job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or perhaps purposely not waiting because of the (removed) multi-instance capabilities... as long as all the InvocationIDs were unique.

That all goes out the window with MI disabled.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: It's not a bad idea to check that DSSetParam() has worked correctly.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

ray.wurlod wrote::idea: It's not a bad idea to check that DSSetParam() has worked correctly.
Thanks a lot to all of u guys.
I just added the wait command and it worked fine.
Thanks,
Madhavi
Post Reply