Page 1 of 1

using switch stage filtering different values into one file

Posted: Wed Sep 02, 2015 5:27 pm
by deesh
Hi,

scenario: i have 5 columns A,B,C,D,E

when month 1, want to populate
A,B,C,D,E

when month 2, want to populate

A,B,D,E

when month 3, want to populate
A,B,E

but 3 output file name is should be same
please tell me how to do this scenario

I tried once. but if i use same name for 3 outputs file is currepting
If i use seperate name for 3 outputs fles are good

Posted: Wed Sep 02, 2015 9:14 pm
by ray.wurlod
The problem here is in the operating system, not in DataStage. You are not permitted to have multiple open-for-write calls at the same time for the same file.

Run the three outputs into three separate Sequential File stages populating separate files. Use a condition to detect month number and rename the appropriate temporary file to the actual target file name that you need.

Posted: Thu Sep 03, 2015 7:01 am
by qt_ky
Could you merge or concatenate all Switch stage output columns into a single column, then use the Funnel stage before writing into a single file?

Posted: Thu Sep 03, 2015 8:31 am
by rkashyap
Can you use Transformer?

For Switch stage ... see excerpt from sec 9.3 of red-book InfoSphere DataStage: Parallel Framework Standard Practices
9.3 Filter and Switch stages
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.