Still a bit difficult to understand the problem virgo, but let me try to explain how I have interpreted your info.
Generally, it seems you are up for some redevelopment as you have a timing problem (33 hours is along time) and an accuracy problem (whatever your code is doing now, it's not giving you the right answer, so needs to be changed). So don't be afraid to thow out bits of code that you already have when you find it's inefficient.
Can you establish where the bulk of your 33 hours is spent in the code ? If you can, then thats an area you can consider to review. (not your primary concern I know, but 33 hours seems a long time

)
Can you establish how far through your code you get BEFORE the data gets messed up ? What I mean is, is the data only messed up in the last (fifth) file ? If so, then thats the code that needs to be changed, the code that feeds the data into the fifth file.
From what you said, it seems that the last file has a set structure of rows (as well as of course columns [fields]) so that you possibly have a CASE statement in your code that controls the update of data into the fifth file.
If over time, your data has changed, you may need to change the conditions defined in the CASE statement.
If your rows are defining categories (or whatever) and your columns (except the category of course) are numerical data, and you have a large file (ie many records), if your code is trying to TOTAL the file on the category, then you want some free disk space for temporary files created behind the scenes, and patience, as this can take a while to complete. If this is the case, consider placing your data into separate files until after the TOTAL command is complete, and then combine the smaller files into one for your report.
Again, I am just guessing. Any further info on the problem might help towards a better solution for you.
Pete Bloomfield
Down Under