Looping concept in Datastage

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
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

Looping concept in Datastage

Post by balu536 »

Hi,
I need to implement a looping concept in one of my jobs.

I'll be having a count value in a column in one of my tables.Based on the count value present, i need to run my job that many times in sequence.

Say for example if count value is 7, i need to run my job 7 times, each time passing value as 1,2,3,4,5,6,7. This count value is dynamic. Say if it's 15 then i need to run my job 15 times each time passing value 1,2,3.......15.

Please help me on how to implement this logic (in sequencer)

Thanks in Advance.

Regards,
Balakrishna
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

First capture row count from the table then use Start loop activity set lower limit to 1 (From) and Upper limit to "rowcount" (TO) and step by 1.

This will help you....
Cheers
Ravi K
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

Post by balu536 »

Thanks for your help.

But how to pass individual value of counter each time to job (like 1,2,3,...7).
Say if count is 7, then how to pass 1,2,3,4,5,6,7(i.e 1 for 1st run,2 for 2nd run....7 for 7th run) values each time when job is executed
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

While calling the job pass "counter" activity variable of Start Loop activity as job parameter.
Cheers
Ravi K
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

Post by balu536 »

Thank you....
Finally got it.
Post Reply