Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DFSORT/ICETOOL :: How to split the records using the amount field

$
0
0
Author: vnktrrd
Subject: How to split the records using the amount field
Posted: Fri Oct 28, 2016 7:33 pm (GMT 5.5)

Hi,

I have an amount field in a file and I want to split the records into multiple records 250000 each into one file until the total number of records reaches 10. Even after 10 splits if the amount is greater than zero then write the record into a separate file with the remaining amount.

For ex input file has below data.
Code:
12345 2550000

And I want the output file-1 like this
Code:
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000
12345 250000


Output file-2 like this
Code:
50000


Output file-2 should only be written when the amount field has value greater than zero even after 10 splits.

Please advise.

Thanks,
Ramana.

Code'd correctly


Viewing all articles
Browse latest Browse all 8500

Trending Articles