This is the second part of the trilogy I started last week:
- Change the file's size and reuse deleted records
- Remove the deleted records from the file
- Create a program to perform both of the above
In this post I will be giving an example of how I chose to remove the deleted records from all of the files in a library.
When a record is deleted from a file its space is not available to be reused, unless the file is reusing deleted records. Over time this can result in files have a few active records and many deleted ones. This is a waste of the available storage.
The Reorganize Physical File Member command, RGZPFM, is the command that will remove the delete records from a physical file. You need to be careful when using this command. If any of the files in the library are record address files the reorganization could make it impossible to retrieve the expected records from the file, do not reorganize them.



