Pass parameter value file in Job sequence loop

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
le thuong
Premium Member
Premium Member
Posts: 76
Joined: Wed Sep 09, 2009 5:21 am

Pass parameter value file in Job sequence loop

Post by le thuong »

I have a loop in a Job sequence calling an elementary job N times. A parameter set is defined with N value files (each value file containing 3 parameters).
How can I specify in the Job sequence to pass value file 1 during call 1, value file 2 during call 2, etc...
Thuong

best regards
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Set it up in a delimited list or a dynamic array and then leverage the Start Loop's "loop counter" to pass the correct value each iteration.
-craig

"You can never have too many knives" -- Logan Nine Fingers
le thuong
Premium Member
Premium Member
Posts: 76
Joined: Wed Sep 09, 2009 5:21 am

Post by le thuong »

chulett wrote:Set it up in a delimited list or a dynamic array and then leverage the Start Loop's "loop counter" to pass the correct value each iteration.
Thank you Craig. I see how to pass the loop counter as parameter from the sequence job to the called job, but I don't see how to pass the value file name (name 1 for iteration 1, name 2 for iteration 2, etc...).
Thuong

best regards
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This post might help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
blewip
Participant
Posts: 81
Joined: Wed Nov 10, 2004 10:55 am
Location: London

Post by blewip »

Is the problem actually passing the details of which value file to use in the sequence?

In the sequence parameters you can hard code it to any of the values. However the sequence doesn't seem to let you define a variable that will contain which value file to use?

The only option I can think of is to call the job using a script, and to pass is the variable this way. Which is a bit clunky
Modern Life is Rubbish - Blur
le thuong
Premium Member
Premium Member
Posts: 76
Joined: Wed Sep 09, 2009 5:21 am

Post by le thuong »

The sequence job (with a loop) does not allow passing value file N (of a parameter set) at iteration N (of the loop) to a called job.

We have developed a workaround solution:
- Sequence job with a loop calling Job A, then Job B.
- Job A has 1 parameter (Iteration number), reads a sequential file where each record corresponds to a value file of our initial Parameter set and writes 1 record (depending on the Iteration number) to another Parameter set (which is also a sequential file).
- Job B will make use of this new parameter set, populated with new values on each iteration.
Thuong

best regards
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would imagine that, with a little thought, you could use a UserVariables stage to build a delimited list of parameter values and then refer to it with the loop counter.
-craig

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