Page 1 of 1

Sequencer ALL or Any - I need both

Posted: Tue Aug 31, 2010 11:42 pm
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 ... ?.

Posted: Wed Sep 01, 2010 1:16 am
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.

Posted: Wed Sep 01, 2010 4:36 pm
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

Posted: Wed Sep 01, 2010 5:34 pm
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

Posted: Wed Sep 01, 2010 5:43 pm
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.

Posted: Wed Sep 01, 2010 10:43 pm
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.

Posted: Wed Sep 01, 2010 10:45 pm
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.

Posted: Thu Sep 02, 2010 12:43 am
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...

Posted: Thu Sep 02, 2010 5:32 am
by ray.wurlod
The three sequencers achieve nothing, your job design would still have the originally-reported problem.

Posted: Thu Dec 16, 2010 11:36 am
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.

Posted: Thu Dec 16, 2010 4:12 pm
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

Posted: Thu Dec 16, 2010 5:24 pm
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?