View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi All,
I have written a reporting program.It works fine when the number of records in the input are around 100,000.Our input file has more that 1,300,000 records.There are duplicates records corresponding to a key.Is there any way to split the file so that we can always include all the records for the last key and the next split should start with next key.
For example
Input is
A 1
A 2 ---------> 100,000 records
A 3
B 1
B 2
B 3
When we do a split by 100,000
Output of split should be is
Split 1
A 1
A 2
A 3
Split 2
B 1
B 2
B 3
There is no limit on the number of records that we can have for a particular key.
Can we do it using sort?
Thanks in Advance. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It's not at all clear to me what it is you want to do.
A 1
A 2 ---------> 100,000 records
A 3
There appears to be 100002 records for this key, so what does that have to do with splitting by 100000?
How many output files are you expecting? What is the RECFM and LRECL of the input file?
And most importantly, what are the "rules" for splitting the input records to the output files?
You need to do a better job of explaining what you want to do before I can help you. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi Frank,
The input file may have up-to 1,300,000 record.So, I need to split them in 13 parts.The problem is that there are duplicates records corresponding to a key.If I directly split them by 100,000 then I might miss some of the data for the last key and it will again included in next file.
RECFM=FB and LRECL = 213.
There is only one Rule :- Splitted file should have all the records for the last key that is on 100,000 .................1,300,000 record and it should not be included in next split. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|