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.
Thanks

Showing Answers 1 - 12 of 12 Answers

Dheerendra

  • 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

Prasad

  • Dec 2nd, 2014
 

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

  Was this answer useful?  Yes

Gandhi

  • 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

Vinay

  • 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