Design scenario for calling sequence multiple times

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
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Design scenario for calling sequence multiple times

Post by RK72 »

I have a very basic design but am wondering if it's possible to use the start and end loop activity for this. As the title suggests i have a sequence that needs to be called several times by passing a different file name each time.

For now i simply have a master sequence that has multiple job activity stages. My question is can the same be accomplished using the loop activity stages and if so how will i pass different file names? Thanks!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Definitely. Use a "list of things" loop. Pass it a delimited list of file pathnames. Within the loop access the activity variable StartLoop.$Counter which will contain the pathname of the file for that iteration. (StartLoop needs to be replaced with the name you used for your Start Loop activity.)
Last edited by ray.wurlod on Tue Feb 26, 2013 7:33 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

Sorry..... I'm unable to see your entire post. Is there anyway I can do that without the price tag? Thanks!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You wouldn't have missed much, so I unprotected it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

Thank you for unprotecting it and apologize for the delayed response. The "list of things" seems to work fine as the loop goes over as many items as I have.

But I seem to be unable to pass different parameters to this Job Activity. For example, every run will have a unique identifier that needs to be passed to the Job. How can I accomplish this?

Thanks in advance!
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

You mean within in the loop you have to pass more than one parameter and that too differently?
Tell number of parameters and what are those.
Thanks,
Prasanna
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

Yes, that is correct. For now I have only 2 params; file name and unique identifier. So if the job reads 4 files, I'll have to pass 4 file names (which the loop handles) plus 4 different values for Identifier that will be passed to the job inside a sequence....
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

So one more question at what frequency this unique identifier can be reset.

If it is for a run:
1) You can have a user variable activity side the loop and increment it. Guess there will be more better solution than this

If it has to be unique over a period of time, you have to use a external sequencer or maintain the value in a file. increment in each run , rewrite it.
Thanks,
Prasanna
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

Thanks for the responses. I'm unsure whether I can write to a file and read from it as the params are passed via a UNIX script....

And to answer the frequency of reset Q, I'm not sure about that one either. All I know is that they have to be unique for every run and there may be thousands of run for the same job.
Post Reply