How can I use a parameter, say FLAG_X, to branch in two different directions in a parallel job? Eventually the two paths will converge somewhere in the job, perhaps in a Transformer. So in effect, I want to skip a section of a job based on the value of that parameter. The job would look like this:
DB2 --> check FLAG_X value --> if 1 --> go to link1 --> ... TransformerZ
--> otherwise go to link2 --> ... TransformerZ (same Transformer as above)
I've looked at Switch but it looks at a file/table columns, not parameters.
I'm also considering a Transformer to do a constraint on FLAG_X, with Otherwise, and the two paths meet at a Funnel (?) before going into TransformerZ.
Any other suggestions?
Thanks in advance.
Branch in a job conditional on parameter
Moderators: chulett, rschirm, roy
Branch in a job conditional on parameter
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
Sr Consultant, Data Quality
San Antonio TX
Another possibility is to use a Filter-Stage instead of a Transformer. However, the filter-command of the filter-stage is applied as an interpreter-command for each row. The RedBook "InfoSphere DataStage Parallel Framework Standard Practises" states:
"The Filter and Switch stages evaluate their expressions at runtime for every input row. Because it is compiled, a parallel Transformer with output link constraints is faster than a Filter or Switch.
Use of Filter and Switch stages must be limited to instances where the entire filter or switch expression must be parameterized at runtime. In a Parallel Transformer, link constraint expressions, but not data, is fixed by the developer." (page 147)
So use a parallel-transformer when only one side of the filter-expression needs to be parameterized. If you need to parameterize both sides - or even more complex conditions - , use a filter- or switch-stage.
"The Filter and Switch stages evaluate their expressions at runtime for every input row. Because it is compiled, a parallel Transformer with output link constraints is faster than a Filter or Switch.
Use of Filter and Switch stages must be limited to instances where the entire filter or switch expression must be parameterized at runtime. In a Parallel Transformer, link constraint expressions, but not data, is fixed by the developer." (page 147)
So use a parallel-transformer when only one side of the filter-expression needs to be parameterized. If you need to parameterize both sides - or even more complex conditions - , use a filter- or switch-stage.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon