Looping on Value file name in Parameter Set

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
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Looping on Value file name in Parameter Set

Post by atulgoel »

I have a parameter set having 6 parameters and 20 value file set. I need to run the job in sequence 20 times with different value file name each time.

I have created a delimited list of value file names as below:

ValueFileName1,ValuefileName2,ValueFileName3.... and so on...

Now I wanted to pass ValueFileName1 at first iteration and ValueFileName2 at second iteration.

I am not getting option to pass the value File Name in the job Activity from StartLoop.$counter.

Is there any way to pass the valuefilename to job activity from loop counter?
Atul
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No problem. Use an Execute Command activity to read the file (use cat command for example). Remove the line terminator, either using a tr -d command in the pipeline, or using a User Variables activity. You now have a comma-delimited list that the Start Loop activity will be happy with.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Not with the job activity stage unfortunately. It limits you to choosing a value file name from a drop down list. It's not possible to specify a parameter.

As a workaround, you can use the execute command activity to run the dsjob command where you should be able to use $Counter in setting the values file to use.

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

Post by ray.wurlod »

One of us is misunderstanding the question. I have assumed it's the same job at every iteration, having a value passed to one of its parameters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
atulgoel
Participant
Posts: 84
Joined: Tue Feb 03, 2009 1:09 am
Location: Bangalore, India

Post by atulgoel »

yeah. It will be a same job which needs to be run with different Value File at every Iteration.

To resolve the issue, I have created the file with the values of value file set and reading it using execute command stage and then passing the required value to loop .
Atul
Post Reply