Converting indexed files

vutil can convert an indexed file created by RM/COBOL-85 into a Vision file. This is useful when you are moving data from an RM/COBOL-85 application to an ACUCOBOL-GT application. The command is:

vutil  -convert  [ -ac ]  [ +c ]  [ -f # ]  [ -23456 ]
                 [ -q ]  [ -d dir ]  [ files ]

The "convert" option starts with the same letter as the "check" option described earlier. You must use at least two letters of the word "convert" in order to specify this option. If you just use "-c", vutil will assume that you are specifying the "check" option.

The "convert" function will take each named file and convert it from an RM/COBOL-85 indexed file to a corresponding Vision file. The Vision file replaces the original RM/COBOL-85 file, so you should have a current backup of the original files. If no files are specified, then the standard input is read for a list of files to convert.

Normally the resulting Vision file will be compressed if the original file has compressed records (this is the RM/COBOL-85 default). Specifying the "-c" option will cause the resulting file to have uncompressed records regardless of the original file; using "+c" will cause the resulting records to be compressed.

The "-f #" option sets the compression factor to be used when the file is converted. This option does not force the use of compression, it merely sets the compression factor if compression is used. The compression factor, a numeric literal, specifies how much of the space saved by compression is actually to be removed from the record.

Normally vutil will warn the user about the impending conversion and ask if he or she wants to continue. The "-a" (for "automatic") option suppresses this warning. This can be useful when you are calling vutil from another program.

The -6 option specifies that you want the resulting file to be in Vision Version 6. The -5 option specifies that you want the resulting file to be in Vision Version 5. The -4 option specifies a Vision Version 4 file. A -3 means a Version 3 file, and -2 specifies a Version 2 file.

The "-d" option specifies that you want the converted files to be placed in a new directory. Dir should be the name of a directory on the machine other than the directory containing the files to be converted. When "-d" is specified, the original files are not destroyed. Instead, the converted files are placed in dir. The "-d" option implies the "-a" option.

The "-q" option causes vutil to exit (with status 99) if user interaction is required.

There are a few types of files that cannot be converted due to restrictions in Vision. Any of the following properties will cause vutil to print a message and leave the file alone:

  1. A record size or block size greater than 32 KB.
  2. More than 120 keys.
  3. An individual key with more than 250 bytes in it.
  4. A non-ASCII code-set or collating sequence.

Some files cannot be converted due to unresolved format differences. A file with split keys cannot be converted for this reason.

If the original file has variable size records, vutil will convert these to fixed size records with space padding. These files should be compressed to keep disk usage down.

vutil makes a copy of the file while it is converting it. You must have adequate disk space for vutil to complete its conversion. Also, RM/COBOL-85 indexed files and Vision files differ in the amount of disk space they use. This difference is fairly unpredictable and can vary quite widely. Sometimes the Vision files are smaller, and sometimes the RM/COBOL-85 files are smaller. Be sure to have plenty of spare disk space when you start converting files to accommodate the potential difference.