Looping with different parameters in a sequencer

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
lindatgeorge
Participant
Posts: 34
Joined: Mon Jun 15, 2009 12:16 am
Location: Bangalore

Looping with different parameters in a sequencer

Post 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.
datisaq
Participant
Posts: 154
Joined: Wed May 14, 2008 4:34 am

Post by datisaq »

Enclosed your job activity stage in before and after loop stage.
Used numeric loop counter from 1 to 4..
IBM Certified - Information Server 8.1
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

You can also implement the loop feature using shell script and then call the job

Regards
Sreeni
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If it's exactly four times you could simply emplace four Job activities in the sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lindatgeorge
Participant
Posts: 34
Joined: Mon Jun 15, 2009 12:16 am
Location: Bangalore

Re: Looping with different parameters in a sequencer

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

My journey down that path documented here: viewtopic.php?t=127425
-craig

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