Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Processing of Files

Status
Not open for further replies.

wvjim

Programmer
Jan 11, 2001
25
0
0
US
I am trying to update records in a batch process. I don’t want to update all records but rather to update specific records based on their content with other records. As I scan through a file and find a zero date (not defined as a date field) I move the last valid date read into that new record. This “works” fine with an ado recordset and straightforward update processing, however, it consumes quite a bit of time. I tried changing to batch processing (rs.UpdateBatch) and that gives me a run time error that I’m not sure how to handle. The run time error is “row handles must be released before new ones can be obtained”. I would have to assume this is because I’ve simply changed my locking mechanism and added the Update command. Here, again, I’m not sure what I need to do differently. I have been trying to get my ADO file handling techniques from a pretty good book by Steven Holzner. I would have to say that he had the method backwards (rs.BatchUpdate instead of rs.UpdateBatch) but for the most part it seems to give pretty good instruction & examples.



I have been programming for about 35 years (hold on to your hats) in RPG. When I perform this batch process with RPG (we have an emulator) it takes 11.5 seconds on a file with about 25000 records. The same process in VB6 takes right at 2 minutes. I can see how the differences in how each of these two languages handle files might make a difference, but, a factor of greater than 10 would imply I’ve done something drastically wrong.

The files I'll be working with range from about 20,000 records to about 2 million. This would present a pretty significant problem on the largest of my files. The amount of time to process would be quite excessive. This is the first of many projects I'll need to perform that I would consider batch processes. In a lot of these processes I'll simply be reading in the database to formulate a summary data base or output report and I don't think those will present a problem. I'm not really sure about that however. How does a record set in ADO actually process this information? Does it read the entire database into memory? Does it read it to some form of virtual memory? What really happens here?



Thanks in advance, Jim

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top