PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Set up your file to reuse deleted records

View previous topic View next topic Go down

Set up your file to reuse deleted records

Post  maran on Sun Aug 12, 2012 9:31 pm

Set up your file to reuse deleted records

Rather than retaining what is essentially empty file space for deleted records, you can change a physical file so that OS/400 reuses file space currently allocated for deleted records every time you insert a new record in the file. You can change an existing file so that it starts reusing deleted records by using the Change Physical File (CHGPF) command, like this:

CHGPF FILE(LIBRARYNAME/FILENAME) REUSEDLT(*YES)

Once executed, OS/400 will start reusing deleted records whenever it inserts a new record. But there are a few downsides to this technique. First, it won't make all the deleted records in a file magically disappear. If you have a large number of deleted records in your target file, you may want to start using this parameter only after you reorganize, clear the file, or copy the records out of and back into the file again. Second, you will probably never bring down the deleted record count in a file to zero. This is because the ratio of added records to deleted or changed records is never a direct one-to-one count. My experience with REUSEDLT is that the file will still contain a number of deleted records, even after you make this change. Reusing deleted records only slows down the growth in deleted records; it doesn't stop it. You will still need to clear or reorganize the file occasionally to bring the number of deleted records down to zero again.

Using REUSEDLT also destroys relative record processing for a file, because records are no longer added to the end of the file; they are inserted wherever there is empty space left over by deleted records. OS/400 will also stop you from turning on REUSEDLT if the physical file uses FIFO or LIFO duplicate key ordering or if the file has any logicals built over it that use FIFO or LIFO duplicate key ordering.

It's also worth noting that you can only change this parameter if no process or job has a lock on the file you're trying to modify. So for busy files that are constantly being used, you may need to find a time when no one is using the file to set this parameter.
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum