split one input file into multiple output files

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
kishorenvkb
Participant
Posts: 54
Joined: Mon Dec 24, 2007 9:27 am

split one input file into multiple output files

Post by kishorenvkb »

Hi All,

What is the most optimum way of splitting one input into 3 output files based on the filed in the input.

Input is being read from the Teradata table and the output should go into 3 different files based on the value in one column of the input data that is read from Teradata.

Thanks in advance

Kishore
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If there are only three (or few) distinct values in the column, Switch stage.

If you're reading in sequential mode from Teradata consider using a three-node configuration file and a modulus partitioning algortihm. You may need to map the three values to integers using a Modify stage. Hash partitioning can not be guaranteed to work. Write to a Sequential File stage that writes to precisely three files - one should be written from each partition.

Otherwise investigate Filter or Transformer stage, each of which has a computation overhead.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply