Page 1 of 1

Looping with different parameters in a sequencer

Posted: Mon Jun 29, 2009 8:21 am
by lindatgeorge
Hello,

I have a sequencer which in turn calls 2 sequences and a job activity. After the two sequences completed successfully, I want to run the job activity 4 times,each time passing different parameters.

I am relatively new to datstage.Could you please help me to implemet this.

Posted: Mon Jun 29, 2009 8:38 am
by datisaq
Enclosed your job activity stage in before and after loop stage.
Used numeric loop counter from 1 to 4..

Posted: Mon Jun 29, 2009 9:18 am
by priyadarshikunal
I would do it with a list loop.
put the parameters in the list and pass counter to job activity as a parameter.

Or if you need to fetch the parameters dynamically then a numeric loop followed by mechanism to fetch the parameter and then pass it to the job activity.

Posted: Mon Jun 29, 2009 9:19 am
by Sreenivasulu
You can also implement the loop feature using shell script and then call the job

Regards
Sreeni

Posted: Mon Jun 29, 2009 4:52 pm
by ray.wurlod
If it's exactly four times you could simply emplace four Job activities in the sequence.

Re: Looping with different parameters in a sequencer

Posted: Tue Jun 30, 2009 12:18 am
by lindatgeorge
Thanks a lot for everyone's help.I tried using loop activity with list. I am able to pass one parameter each time.But I need to pass 4 parameters for the job activity and those 4 parameters should differ for each run.

Please let me know,how to handle this.

Linda

Posted: Tue Jun 30, 2009 1:01 am
by ray.wurlod
ray.wurlod wrote:If it's exactly four times you could simply emplace four Job activities in the sequence.
Otherwise your list needs to be more complex, for example "A1|A2|A3|A4,B1|B2|B3|B4,C1|C2|C3|C4,D1|D2|D3|D4", and decomposed within the loop, probably using Field() functions. $Counter will be "A1|A2|A3|A4" on the first iteration, "B1|B2|B3|B4" on the second iteration, and so on.

Posted: Tue Jun 30, 2009 3:39 am
by priyadarshikunal
ray.wurlod wrote: Otherwise your list needs to be more complex, for example "A1|A2|A3|A4,B1|B2|B3|B4..
Exactly. You need two delimiter, one to seperate parameters for the same run. and second to differenciate set of parameters between the runs.

In above example from Ray "|" is used for first purpose and "," for second.

If you use "," as seperator for you list loop first time it will pass A1|A2|A3|A4 as counter. Then you can use field function to break the counter in four parts and pass them to your 4 parameters and so on for the next runs.

Posted: Tue Jun 30, 2009 6:21 am
by chulett
My journey down that path documented here: viewtopic.php?t=127425