using switch stage filtering different values into one file

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
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

using switch stage filtering different values into one file

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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?
Choose a job you love, and you will never have to work a day in your life. - Confucius
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post 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.
Post Reply