Error in Sequence

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
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

Error in Sequence

Post by sundar »

Hi all,

I am having 5 jobs in the sequence,I want all the 5 jobs to run first
and for the second time,I want to skip the second job,its working well for the first time with execution action reset only and for the consecutive run it gives a fatal error.Is there any option to do this.

Error calling DSRunJob(job2_09L2), code=-2 [Job is not in the right state (compiled and not running)]

With Regards,
Sundar.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I am not clear on exactlywhat you are intending to do; but the error messages means that when you are trying to reset iyour job it is most likely still running.
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

Post by sundar »

Hi Arndw,

For the first time i want all the jobs to run.When i run the sequence for the second time onwards, it should skip the second job.

With Regards,
Sundar.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How do you differentiate a first and a second run in your sequence? It seems that the first run you start the job #2 and don't wait for it to complete, so when you call it a second time it is still running and causes the error you posted.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In your job activities, specify "reset if required, then run" as the run mode. Skipping is managed via the compilation options in the job properties window of the job sequence itself; the check box names are quite self-explanatory, and there's always Help.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

HI,

If you intend to run the second job for very first time and not from second run onwards, then you can built your own logic to acheive. Use WaitForFile activity after Job1 and trigger if after the first job finish ok.
In WaitForFile stage, just check for some indicator file say 'Indicator.txt'.
Create two output link from WaitForFile stage. Introduce the Job2 to one of the link where the trigger type is Failed.
Another link with the trigger type as OK. This link and and output of the Job2 link connected to a Sequencer with the mode of Any.
After the first run you can just touch the indicator file either by Execude command Activity or by AfterJobSubroutine.

So that from second run, the waitforfile activity after sensing the file will trigger directly to sequencer and skip the Job2.

-Kumar
Post Reply