This configuration variable specifies a format for naming the index segments of Vision 4 and 5 files. (See filename_DATA_FMT for details about naming the data segments, as both variables should be set to corresponding patterns). The configuration variable used is constructed from the file's base name and extension, with all letters converted to upper case and all non-alphanumeric characters converted to underscores, followed by the "_INDEX_FMT" string. Note that by design, this variable does not modify the first specified index segment. The first index segment retains the originally specified name. The filenames of the additional segments of a Vision file are generated from the name of the initial index segment. The filename_INDEX_FMT variable allows you to change the way the names of the following data segments are formed, but the names still originate from the name of the initial index segment. As long as the names are as expected (and you have set filename_DATA_FMT and filename_INDEX_FMT accordingly) the segments will be found properly.

Suppose that the regular name of your COBOL file is /usr1/gl.dat. The variable you would use to set the format for naming the file's index segments is GL_DAT_INDEX_FMT.

The variable must be set equal to a pattern that shows how to create the segment names. The pattern shows how to form the base name and how to form the extension for each segment. Part of this pattern is a special character (such as %d) that specifies how the segment number should be represented. Choices include %d (decimal segment numbers), %x (lowercase hexadecimal numbers), %X (uppercase hexadecimal numbers), and %o (octal numbers).

For example, setting the variable GL_DAT_INDEX_FMT=gl%d.idx would result in index segments named /usr1/gl0.idx, /usr1/gl1.idx, /usr1/gl2.idx, and so forth.

Escape sequence definitions:

The %d in the value of the filename_INDEX_FMT above is a printf-style escape sequence. Most reference books on the C language contain an in-depth explanation of these escape sequences, and UNIX systems typically have a man page (man printf) that explains them in detail. Here are the basics:

  • %d expands into the decimal representation of the segment number.
  • %x expands into the hexadecimal representation (with lower case a-f) of the segment number.
  • %X expands into the hexadecimal representation (with upper case A-F) of the segment number.
  • %o expands into the octal representation of the segment number.
  • You can add leading zeros to the number (to keep all the file names the same length) by placing a zero and a length digit between the percent sign and the following character. %02d would result in 00, 01, 02, and so forth when expanded.
  • To embed a literal "%" in the file name, use %%.

The escape sequence can be positioned anywhere in the file name, including the extension.

While the runtime checks for this segment naming variable in the runtime configuration file as well as in the environment, utilities such as vutil and vio check only the environment. Therefore, if you are using this variable with the runtime and vio or vutil, you must set the variable in the environment and not in the configuration file.

Two configuration variables affect the value of this variable: V_BASENAME_TRANSLATION and V_STRIP_DOT_EXTENSION.

The filename translation performed by this configuration variable is performed by Vision itself. The runtime can also perform filename translation. See File Name Assignments for more information.