filename_DATA_FMT

This configuration variable specifies a format for naming the data segments of a Vision 5 file. The configuration variable starts with the physical file's base name followed by an underscore and the file's extension, all in uppercase.

Suppose that the regular name of your COBOL file is /usr1/gl.dat. The variable you would use to set the data segment naming format for this file is GL_DAT_DATA_FMT.

The variable must be set to a pattern that shows how to create the segment names. The pattern shows how to form the base name and extension for each segment. Part of this pattern is a special escape sequence (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_DATA_FMT=gl%d.dat would result in data segments named /usr1/gl.dat (remember that the first data segment is not affected), /usr1/gl1.dat, /usr1/gl2.dat, and so forth.

Escape Sequence Definitions:

The %d in the value of the filename_DATA_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 lowercase a-f) of the segment number.
  • %X expands into the hexadecimal representation (with uppercase 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. For example, %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.

Note: While AcuServer 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 vio or vutil, you must set the variable in the environment and not in the configuration file.

See filename_INDEX_FMT for details about naming the index segments. Both variables should be set to corresponding patterns.