Sequencer ALL or Any - I need both

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
moose2079
Premium Member
Premium Member
Posts: 48
Joined: Tue Mar 07, 2006 4:52 pm
Location: Australia

Sequencer ALL or Any - I need both

Post by moose2079 »

Hi there,
I am testing a DataStage Sequence - it has branching in it - I am using a Nested Condition - that runs 3 possible out links - sometimes only one will run, sometimes 2, sometimes all 3 - depending on dates and other parameters passed into the Nested Condition my problem is that it runs fine with a Sequencer set to all ONLY if all three links fire up .... if only 1 or 2 fire up the Sequence fails on Sequencer never being exited ....it runs with Sequencer set to Any and handles one link . but if more than one link fires up - then the Sequencer will pass control to the next job once any one of the links finish - which means the 2 other links are still running when control is passed to next job in sequence - not what I wanted .... is there away to 'collect' all 3 links - when any or all of those 3 links have fired up and finished before passing control to the next job ... ?.
YUM
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's a difficult question. Theoretically all triggers in a Nested Condition will fire very close to simultaneously, so the combination of jobs will start at very close to the same time.

You could use a Routine to determine which jobs are running and wait for all of those (and only those) to finish. This could sit downstream of an Any sequencer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
moose2079
Premium Member
Premium Member
Posts: 48
Joined: Tue Mar 07, 2006 4:52 pm
Location: Australia

Post by moose2079 »

Cool Thanks Ray - I was thinking User Varibles - but this is much simplier - do you have examples of this type of coding? - I am guessing Innovocation ID and Job Status - as you said - check on the three possible streams after exiting the Any Sequencer - with a wait type loop on those jobs running
YUM
moose2079
Premium Member
Premium Member
Posts: 48
Joined: Tue Mar 07, 2006 4:52 pm
Location: Australia

Post by moose2079 »

Ray - what about a sub sequence - that gets passed the current Nested Condition triggers - to run a Nest_Condition within the Sub sequence - when any or all jobs finish in the sub Sequence it returns to the calling Sequence - no routine necessary - will test and advise results
YUM
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just wanted to make sure you were aware of the Reply to Topic 'button' in the future - it is down at the bottom left-hand side of the page. There's no need to quote an entire post simply to reply - do that when it makes sense or you need to respond to certain segments of other posts, but not all the time please.

I 'fixed' your current posts in this thread, in case you are wondering what might have happened.
-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 »

moose2079 wrote:Ray - what about a sub sequence - that gets passed the current Nested Condition triggers - to run a Nest_Condition within the Sub sequence - when any or all jobs finish in the sub Sequence it returns to the calling Sequence - no routine necessary - will test and advise results
I thought (briefly) about that (in terms of binary logic using Sequencers as AND and OR gates) and could not devise a solution. Let us know if you manage to do so.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

moose2079 wrote:Cool Thanks Ray - I was thinking User Varibles - but this is much simplier - do you have examples of this type of coding? - I am guessing Innovocation ID and Job Status - as you said - check on the three possible streams after exiting the Any Sequencer - with a wait type loop on those jobs running
(Optional) Wait a small interval so all jobs can achieve running status.
Input argument is delimited list of job names.
1. Attach to each of those jobs.
2. Determine status - build list of running jobs, detach from the others.
3. Execute DSWaitForJob in a loop until none of the jobs has a status of running.
4. Detach from each of the jobs initially determined as running.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Post by datisaq »

How about updating the design like this :-



nested_cond ----> 3 o/p links(Each o/p link is having sequencer with ALL mode)

Then one o/p link from 3 sequncers to a single sequencer(with ANY mode) followed by your next job activity stage.

the overall design looks like this

nested cond ----> 3 seqncers ----> 1 sequencer ----> job activity


Datastage experts please correct me if i'm wrong...
IBM Certified - Information Server 8.1
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The three sequencers achieve nothing, your job design would still have the originally-reported problem.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post by Nagin »

YUM,
Did you ever find a solution for this? If so, can you please let me know?

I am facing the same exact problem. I can do this in a shell script but I am concerned about losing the parallelism.

I appreciate your help.
moose2079
Premium Member
Premium Member
Posts: 48
Joined: Tue Mar 07, 2006 4:52 pm
Location: Australia

Post by moose2079 »

Nagin wrote:YUM,
Did you ever find a solution for this? If so, can you please let me know?

I am facing the same exact problem. I can do this in a shell script but I am concerned about losing the parallelism.

I appreciate your help.
Yep the solution was to 'nest' a sub sequence - ie branch to the same sub sequence - but pass a different set of parameter settings
YUM
Nagin
Charter Member
Charter Member
Posts: 89
Joined: Thu Jan 26, 2006 12:37 pm

Post by Nagin »

Here is the approach I have now

Code: Select all

JobAct1-----> JobAct2----->  NestCondition -----> Seq1
                                                  Seq2  -->JobAct3-->JA4
                                                  Seq3   
Seq1, Seq2 and Seq3 get kicked off from the NestCondition and after the completion of ANY or ALL of them JobAct3 and JA4 should get kicked off.

And, the some times only Seq1 may run but not the others and vice versa.


So, you are saying take the NestCondition and put it inside each of Seq1, Seq2 and Seq3 to make it work?
Post Reply