My current index files are not file version 4. Should I upgrade these index files to file version 4?
By upgrading to file version 4 you can take advantage of two very important enhancements.
1. The ability to create large files (greater than 2GB)
2. Atomic I/O (eliminates most file corruption)
Large File Support
There are several steps to adding support for large files for existing index files:
1. The first step is to make sure that the operating system supports the creation of files greater than 2 GB. This may involve changing the file system, a kernel setting, or even the ulimit associated with a user account shell. Your systems support person will need to accomplish this as each operating system may handle it differently.
2. Next, edit the default configuration file (runcobol.cfg) located in the RM/COBOL installation directory (usually /usr/rmcobol). Add the following two records to that file:
RUN-FILES-ATTR LARGE-FILE-LOCK-LIMIT=64
RUN-INDEX-FILES USE-LARGE-FILE-LOCK-LIMIT=YES
**Some systems may require a lower LARGE-FILE-LOCK-LIMIT than the default 64 GB.
3. Run rmdefinx on existing index files that are at the 2 GB limit. The above settings will affect only the lock limit placed into the Key Information Block (KIB) for new file version 3 or 4 indexed files created by the runtime system. Existing indexed files always use the lock limit stored when the file was created. In addition, the file version should be changed to the highest setting your runtime version supports. Only file versions 3 and 4 support large files.
Even if the file is at the highest file version that setting your runtime version supports, you must re-enter the file version setting in order to get the prompt to change the File Lock Limit.
Atomic I/O
Below are the steps for enabling Atomic I/O:
1. Use rmdefinx to change the file version format of existing Index files to version 4, turn on Atomic I/O, and run recovery:
runcobol rmdefinx A=', CONVERT4 , ATOMICIO, RECOVER1'
where is the name of the file to use.
You may run rmdefinx in batch mode in order to convert a large number of indexed files at the same time. To do so, you must construct a batch stream or command script that runs rmdefinx on each index file. Be certain that you have a current backup of all files being converted.
Note that the path to the runcobol and recover1 commands must be specified in your PATH environment variable and the path to rmdefinx must be in your RUNPATH.
The following general example could be used in a .bat file to convert to file version 4 and Atomic I/O, then automatically run the recover1 utility. Also, it will terminate with return code 1 and the file name, if any error occurs:
start /w runcobol rmdefinx a="d:\dat\file1,CONVERT4 , ATOMICIO, RECOVER1"
if errorlevel 1 echo "error on file1" >>errlog
start /w runcobol rmdefinx a="d:\dat\file2,CONVERT4 , ATOMICIO, RECOVER1"
start /w runcobol rmdefinx a="d:\dat\file3,CONVERT4 , ATOMICIO, RECOVER1"
if errorlevel 1 echo "error on file3" >>errlog
.
start /w runcobol rmdefinx a="d:\dat\file,CONVERT4 , ATOMICIO, RECOVER1"
2. Turn on Atomic I/O for new files, by entering this configuration record into your configuration file:
RUN-INDEX-FILES ENABLE-ATOMIC-IO=YES
For more information regarding the RM/COBOL Define Indexed File (rmdefinx) Utility, file version 4, large file support, or, Atomic I/O, please see the RM/COBOL User’s Guide. The RM/COBOL User’s Guide is available on our web site at:
https://supportline.microfocus.com/productdoc.aspx