DSPrepareJob ordering in a job control code

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
anandsiva
Participant
Posts: 41
Joined: Wed May 21, 2008 7:58 pm
Location: Sydney

DSPrepareJob ordering in a job control code

Post by anandsiva »

I have a job control code in which I'm invoking another job. I attached the job to a handler and check if it was attached properly. Then I prepare the job.
DSprepare job was suppose to reset the job if it was in aborted state. It reset the job and also throw a warning message. This is a server job.
*=========================================================================================================================
* Attach the job
*========================================================================================================================
JobName="CMN_Check_Batch_Jbs.":pJOB_NAME

vHandle_Job = DSAttachJob(JobName, DSJ.ERRFATAL)
*=========================================================================================================================
* If the Attachment of Job Failed, it log the error message
*=========================================================================================================================
If NOT(vHandle_Job) Then
vReturnValue=-1
Call DSLogFatal("Job Attach Failed: CMN_Check_Batch_Jbs", "JobControl")
Abort
End
**********Reset the job if the attached job failed***********
vHandle_Job = DSPrepareJob(vHandle_Job)


This code gave the following warning.
Job CMN_Check_Batch_Jbs.PSF_Product_Extract_Mstr_SER_SSIL_Seq must be reset before it can run.

Is there any way to avoid this warning? And why is this happening?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did this message come from DSPrepareJob() or from DSRunJob() ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
anandsiva
Participant
Posts: 41
Joined: Wed May 21, 2008 7:58 pm
Location: Sydney

Post by anandsiva »

This error was because More than one sequence invoke the job with same invocation ID
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... that makes sense, the error was thrown because the job was running.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Doesn't DSPrepareJob() return a status value? The code example is resetting the job handle which means the subsequent use of it will be invalid.
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

My mistake. It returns a job handle.
Post Reply