Loop Activity Problem

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
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Loop Activity Problem

Post by Javieregh »

I'm having trouble in looping with in the sequencer:

My job design is

StartLoopA---->JobActivityA----->StartLoopB----->JobActivityB---->EndloopB---->EndloopA

My first loop (StarLoopA) contains Monday and Tuesday (list loop) and my second loop (StarLoopB) containing 01 and 02 (list loop), I need that the first cycle is Monday01 closure and begin another cycle where Tuesday02 which increase the two loop for the second record.

My problem is that the second loop runs 2 times

Thank for your help..
Javier
Consultant in DTS
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

Now that you've solved it can you please post again advising where the problem lay?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This morning it looks unresolved. [shrug]

You've marked this as a 'TX' job and posted in the Server forum. Doesn't matter per se if you are asking about a Sequence (no 'r') job but make sure you set that appropriately in the future.

Can you explain what your design is meant to do in words please? Better words, that is. Right now you've got a loop inside a loop and from what I can understand from your post, it sounds like it is doing exactly what it should.

Code: Select all

A: Monday
    B: Monday 01
    B: Monday 02
A: Tuesday
    B: Tuesday 01
    B: Tuesday 02
If that's not correct, we need a better explanation of what it is you need.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Loop Activity Problem in more detail

Post by Javieregh »

Hello again, here is the structure that I want to do.

A: Monday
B: Monday 01
Activity
Exit from B
A: Tuesday
B: Tuesday 02
Activity
Exit from B

I want to execute A with Monday go inside the B loop with Monday and 01, and execute the second loop only once.
Then execute Tuesday in A and go inside the B loop with 02 only, I mean execute B loop only once again.

I prefer to use Loop Stages, if it is possible, because the two lists are hard code. I want to combine the first field of the fist list with the first field of the second list and the second time the second field of the first list with the second field of the second list.

Thanks, if you need more detail please let me know.




chulett wrote:This morning it looks unresolved. [shrug]

You've marked this as a 'TX' job and posted in the Server forum. Doesn't matter per se if you are asking about a Sequence (no 'r') job but make sure you set that appropriately in the future.

Can you explain what your design is meant to do in words please? Better words, that is. Right now you've got a loop inside a loop and from what I can understand from your post, it sounds like it is doing exactly what it should.

Code: Select all

A: Monday
    B: Monday 01
    B: Monday 02
A: Tuesday
    B: Tuesday 01
    B: Tuesday 02
If that's not correct, we need a better explanation of what it is you need.
Consultant in DTS
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Loop Activity Problem in more detail

Post by Javieregh »

Hello again, here is the structure that I want to do.

A: Monday
B: Monday 01
Activity
Exit from B
A: Tuesday
B: Tuesday 02
Activity
Exit from B

I want to execute A with Monday go inside the B loop with Monday and 01, and execute the second loop only once.
Then execute Tuesday in A and go inside the B loop with 02 only, I mean execute B loop only once again.

I prefer to use Loop Stages, if it is possible, because the two lists are hard code. I want to combine the first field of the fist list with the first field of the second list and the second time the second field of the first list with the second field of the second list.

Thanks, if you need more detail please let me know.




chulett wrote:This morning it looks unresolved. [shrug]

You've marked this as a 'TX' job and posted in the Server forum. Doesn't matter per se if you are asking about a Sequence (no 'r') job but make sure you set that appropriately in the future.

Can you explain what your design is meant to do in words please? Better words, that is. Right now you've got a loop inside a loop and from what I can understand from your post, it sounds like it is doing exactly what it should.

Code: Select all

A: Monday
    B: Monday 01
    B: Monday 02
A: Tuesday
    B: Tuesday 01
    B: Tuesday 02
If that's not correct, we need a better explanation of what it is you need.
Consultant in DTS
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then you want one loop, not two. And since (AFAIK) you can't iterate through linked lists of variables, you'll need to build your single list with both pieces. For example, the List Loop:

Monday|01,Tuesday|02

Then use the Field() function to split around the pipe for each parameter value. Now, since your second value matches the loop counter, it seems you could dispense with the second list and use a single loop with your original two days. Then for the second parameter, just pass $Counter. Never tried using it by itself, but seems like it should work.

Let us know.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Javieregh
Participant
Posts: 25
Joined: Mon Apr 16, 2007 10:35 am
Location: JavierGH

Post by Javieregh »

Hi Craig
I apply your sugestion and it work!!!

Thank you so much 8)
Javier

chulett wrote:Then you want one loop, not two. And since (AFAIK) you can't iterate through linked lists of variables, you'll need to build your single list with both pieces. For example, the List Loop:

Monday|01,Tuesday|02

Then use the Field() function to split around the pipe for each parameter value. Now, since your second value matches the loop counter, it seems you could dispense with the second list and use a single loop with your original two days. Then for the second parameter, just pass $Counter. Never tried using it by itself, but seems like it should work.

Let us know.
Consultant in DTS
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Curious which way worked for you - the pipe or the $Counter? And please mark this as Resolved now.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply