How to manually set the jobstatus of a job

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
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

How to manually set the jobstatus of a job

Post by pnchowdary »

Hi Guys,

I have a requirement where I need to abort the following job based on a value written to a file using writeu in a routine, in the current job. To achieve this, I need to manually set the Jobstatus of the current job to aborted, so that my next job in the sequence does not get kicked off.

Code: Select all

Job1 -----> Job2 -----> Job3

Based on the value written to a file in Job1, I need to manually set the Jobstatus of Job1 to Aborted, so that Job2 does not get kicked off
Any help would be greatly appreciated.
Thanks,
Naveen
ukyrvd
Premium Member
Premium Member
Posts: 73
Joined: Thu Feb 10, 2005 10:59 am

Post by ukyrvd »

Here is an idea

After Job 1 insert a script and return a value to indicate continue/stop.

Use the script to check the value you are looking for!!
thank you
- prasad
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Ukyrd,
return a value to indicate continue/stop.
what value would you return and how would it stop the next job in the sequence from executing?

Thanks for your reponse.
Thanks,
Naveen
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: How to manually set the jobstatus of a job

Post by chulett »

pnchowdary wrote:I need to manually set the Jobstatus of the current job to aborted
You can't manually set it, so put that approach out of your head.

What you can do is build a routine to read the file which you can execute via the Routine Activity stage between the two jobs. Abort the routine (ie, call DSLogFatal) if you don't like what it reads. Triggers handle the rest.

Why not just do the abort in the original routine?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Hi Craig,

Thanks for the quick reply. I will try to implement your solution.
Thanks,
Naveen
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try to avoid aborting jobs.

You can still exert total control over the sequence using specific values written to files (as you propose), without the need to abort. Use custom triggers and/or Nested Condition activities to control the flow of execution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Post by pnchowdary »

Thanks ray, I will sure keep that in mind.
:D
Thanks,
Naveen
Post Reply