Page 1 of 1

Looping concept in Datastage

Posted: Fri Dec 10, 2010 12:42 am
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

Posted: Fri Dec 10, 2010 1:24 am
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....

Posted: Fri Dec 10, 2010 1:38 am
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

Posted: Fri Dec 10, 2010 2:52 am
by Ravi.K
While calling the job pass "counter" activity variable of Start Loop activity as job parameter.

Posted: Fri Dec 10, 2010 2:55 am
by balu536
Thank you....
Finally got it.