Reallocating Files

Once you have determined that a file or an account needs a new modulo, it is easy to reallocate its space. To change a file’s modulo, simply enter the new number in Attribute 13 of its File Definition item or Account Definition item. It must be enclosed in parentheses. To reallocate the items in the file, you can either perform an account-save or filesave followed by an account or file-restore; or you can copy the data from the file to be reallocated to a newly created file with the correct modulo. Procedures for both of these methods follow.

The most commonly used method for reallocating files is to back up and restore either the account containing the file or the entire data area:

  1. Change the modulo by entering the new modulo, enclosed in parentheses, in Attribute 13 of the File Definition item or Account Definition item.

  2. Back up either the account containing the file (with ACCOUNT-SAVE) or the entire data area (with FILE-SAVE). See Backing Up Files in the Guide to mvBase Files and Accounts for more information about backing up and restoring files.

  3. Restore either the account (with ACCOUNT-RESTORE) or the data area (with :FILELOAD). The file or account will be restored with the new modulo, and all files will be reallocated in one block of contiguous space.

The following method, using the COPY processor, is less common and may not be practical for large files (for example, due to lack of enough disk drive space):

  1. Using CREATE-FILE, create a temporary file with the new modulo.

  2. Using COPY, copy the contents of the file you want to reallocate in the temporary file.

  3. Delete the original file with DELETE-FILE.

  4. Using RENAME, rename the temporary file with the original file name.

See Also

File Maintenance

Tools for Checking File Efficiency