Datastage scenario - Flat file

Source is a flat file and has 200 records . These have to split across 4 outputs equally . 50 records in each .
The total number of records in the source may vary everyday ,according to the count records are to split equally at 4 outputs.
Could someone post an answer for this question.

Showing Answers 1 - 4 of 4 Answers


  • Nov 11th, 2014

Use SEQ---> Transformer stage ----> 4 SEQ Files In transformer stage add constraints as Mod(@INROWNUM,4) =0, Mod(@INROWNUM,4) =1, Mod(@INROWNUM,4) =2, Mod(@INROWNUM,4) =3


  • Dec 2nd, 2014

Use sample stage with 4 outputs in percentage mode
for each 25%

  Was this answer useful?  Yes


  • Jan 13th, 2015

Hi all,
Keep four files as output.Simply give modulus(col_name,4)=0 constraint for first file ,modulus(col_name,4)=1 second file and modulus(col_name,4)=2 for third file and finally modulus(col_name,4)=3

  Was this answer useful?  Yes


  • Mar 19th, 2015

we can use the split command in the Filter section of the Sequential

file stage:
Split -l 50 File.txt Segment
O/P: will give 4 files namely Segmentaa,Segmentab,Segmentac and Segmented each of 50 records.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions