condition in sequencer / jobs

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
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

condition in sequencer / jobs

Post by DS1 »

hello everyone,

I need to give conditions in the jobs/ sequences in such a way that based on the conditions it will execute one of three job.
This condition needs to be passed based on the value of one of the output columns of the previous job.
We are using DS 7.1/

Can anyone help me with this.

Thanks
DS1
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, technically that's what the Nested Condition stage is for as it's basically a user-defined 'branch' in your job flow. You can also manage this kind of thing with normal triggers.

Where does this 'value of one of the output columns of the previous job' that you need to branch based on end up? That's going to drive how difficult you make this. One suggestion would be to look into using the User Status area each job has, you can stash a value there and then any downstream job in a Sequence job can easily leverage it.
-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 »

OR store that value in a hashed file keyed to a hardcoded value and then read that hashed file by UtilityHashLookup() routine in a Routine Activity Stage and branch the execution accordingly.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

Post by DS1 »

thanks for the reply ,

my column is in a dataset.
does that make it easy / difficult ???

i tried using nested conditions, but am not sure of how to provide a condition and that too based on a column that is in the resulting dataset of the previous job.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

a big :oops:
Sorry, my earlier solution wont work. I overlooked the fact that your on PX.
Sorry.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

Post by DS1 »

DSguru2B wrote:a big :oops:
Sorry, my earlier solution wont work. I overlooked the fact that your on PX.
Sorry.
thats ok, but is there some way to make it work?

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

Post by DSguru2B »

Have you tried working with Craig's suggestion? Try it out.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DS1
Charter Member
Charter Member
Posts: 29
Joined: Wed Mar 29, 2006 1:13 pm

Post by DS1 »

yes, i have given a thought to Craig's suggestions but i need some more help on it.
I have asked for some help in previous message ----

''''my column is in a dataset.
does that make it easy / difficult ???

i tried using nested conditions, but am not sure of how to provide a condition and that too based on a column that is in the resulting dataset of the previous job. '''''

It would be very helpful to know more

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Be more thoughtful/specific about your requirement. You say that the branch is based on "a" value. Even though that value is in a Data Set, is it correct that it is nonetheless only a single value? So it would still be possible to use a job to extract that value and write it to a sequential file? (Tip: run this job using a single node configuration file - it only processes one row, so the other nodes would be idle.)

In that case, the solution above is appropriate but with minor changes. Instead of UtilityHashLookup via a routine activity you could use cat via an Execute Command activity to retrieve the stored value, and feed that via an Activity variable (CommandActivityName.$ReturnValue) into your Nested Condition activity's decision expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply