140 pts.
 What is the best way for me to handle clearing work files?
Program in RPGLE. I have 2 work files in my program. They hold possible matching data for a name, birth, etc. I have rules where I search the file and determine how many parameters match. I have to delete records if I don't have a minimum of fields matching.  I make several runs through the file to get the final record. But I then need to clear the 2 work files and start over for the next lookup. What is the best way for me to handle clearing these work files? I think I have a problem with records that have been deleted. DSPFD shows I have 100,000 records, but I really only have 15 records in my file. 

Software/Hardware used:
ASKED: August 26, 2010  7:51 PM
UPDATED: September 1, 2010  12:03 AM

Answer Wiki:
First, run:<pre> CHGPF mylib/myworkfile REUSEDLT(*YES)</pre> The file appears to be continually adding new records at the end of the file rather than reusing space that has been made available by previously deleted records. Then:<pre> RGZPFM mylib/myworkfile</pre> The previously deleted records can have their space returned by reorganizing the file. It probably doesn't actually matter which one runs first. Once both commands run, the problem shouldn't come back unless <mylib/myworkfile> is recreated without setting the REUSEDLT(*YES) attribute appropriately or changed again with CHGPF REUSEDLT(*NO). Tom
Last Wiki Answer Submitted:  September 1, 2010  12:03 am  by  TomLiotta   108,005 pts.
All Answer Wiki Contributors:  TomLiotta   108,005 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

thanks for the info!

 140 pts.