Dynamic parameter passing for different countries

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ysrini9
Participant
Posts: 108
Joined: Tue Jul 12, 2005 2:51 am

Dynamic parameter passing for different countries

Post by ysrini9 »

Hi,

I have requirement like below.

I need to use same set of jobs reusable for all the countries

Ex:\ I have executed 2 jobs for US

C:\US\Brand.txt
C:\US\Brand1.txt

Same set of jobs are present in C:\UK\brand.txt and C:\UK\brand1.txt

How to achive this logic between startloop and endloop

Please suggest me to read path automatically as parameter in runtime and pass to job sequence

Thanks in Advance
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Ok - I believe I understand the question, though I will re-phrase it to make sure.

You have a parameterized job that use different sequential files for different countries. You need to drive them from a job sequence and need it to cycle through a loop sending different parameters to the job each time it executes.

Correct? If so...

Setup two string parameters in your main sequence, something like pFirstPath and pSecondPath. Set their values as follows:

pFirstPath = C:\US\Brand.txt|C:\UK\brand.txt
pSecondPath = C:\US\Brand1.txt|C:\UK\brand1.txt

Set your loop to execute twice.

Then set your file parameters for the job to use these respectively:

Field(pFirstPath,"|",LoopName.$Counter)
Field(pSecondPath,"|",LoopName.$Counter)

I think that will work...
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
nagarjuna
Premium Member
Premium Member
Posts: 533
Joined: Fri Jun 27, 2008 9:11 pm
Location: Chicago

Post by nagarjuna »

you can also do it in unix using dsjob command and passing the parameter .

for i in ` cat parameter`
do
dsjob -run -param $i ......
done
Nag
Post Reply