I did have one batch job that did a:
- clear summary file
- read detail file
- Does 'key' exist in summary file?
== add amount to summary row
- else
== create summary row
- repeat until eof

Which was a LOT of I/O on the summary file. I changed it to
- clear summary file
- read detail file, sorted by key
- sum up by key
- At control break time write out summary row.
- repeat until end

What used to take well over an hour dropped down to a few minutes.
From millions of I/O on the summary file to just a few output operations.


Rob Berendt




Return to Archive home page | Return to MIDRANGE.COM home page