Once you have determined that a file needs a new modulo, it is easy to reallocate the space for it. That is done by specifying a reallocation parameter as Attribute 13 of the File Definition item. The new modulo must be enclosed in parentheses. The reallocation takes place by performing an account-save or file-save followed by an account-restore or file-restore.
The following procedure summarizes how to back up and restore the account containing the file:
Change the modulo by entering the new modulo, enclosed in parentheses, in Attribute 13 of the File Definition item or Account Definition item.
Back up either the account containing the file or the entire data area (with ACCOUNT-SAVE or FILE-SAVE). See Backing Up Files and Restoring Files and Accounts for additional information.
Restore either the account or the entire data area (with ACCOUNT-RESTORE or :FILELOAD). The file will be created with the new modulo and the items will be restored to it.
Restoring an account that has files that need to be resized will be more time-consuming. Each item-ID must be hashed to place the item in a group.
You can also copy the data from the file to be resized to a newly created file with the correct modulo. The method using the COPY processor is less common and may be inappropriate for very large files:
Use CREATE-FILE to create a temporary file.
Use COPY to copy the contents of the file you want to resize into the temporary file.
Use DELETE-FILE to delete the original file.
Create a new file with the new modulo.
Copy the contents of the temporary file into the new file.
Delete the temporary file.
Larger files can be resized by writing the file to backup media with T-DUMP and restoring it to disk with T-LOAD. In both COPY and TAPE operations, make sure that the dictionary items are not forgotten.
Of all of these methods of file allocation, the most common one is a file-save and restore using :FILELOAD. This should be performed by the administrator when no one else is logged on to the system. The :FILELOAD command immediately deletes all SYSTEM entries and Spooler hold files, and requires a backup medium to be ready. Since this save and restore is planned, you should use the validation check of the FILE-SAVE Proc to ensure the backup medium is good before any optional or elective restore.
A full file-restore is the only way to ensure that files will be reallocated in one block of contiguous frames. That is, the primary file area (one frame per group) is followed by all secondary file frames for each group. Reallocating files using COPY or ACCOUNT-RESTORE will use create a contiguous block for primary space, but the secondary space will come off the Overflow Table. A full file-restore can improve performance.
When selecting the reallocation parameter, here are a few things to remember:
The modulo must be an odd number; the system will increase by one to make it odd, if needed.
The modulo should be a prime number.
The modulo should not be divisible by three or five.
These are not hard and fast rules, but help to ensure a more even distribution of items in groups.
See Also