This method lets you specify a format that Vision uses to determine the file names of additional segments. Two formats must be specified: a format for data file extensions and a format for index file extensions. The resulting variables have this general look: filename_DATA_FMT and filename_INDEX_FMT. Each of these variables must be equated with a format code that includes an escape sequence. The valid escape sequences are defined below.
Suppose the regular name of your COBOL file is /usr1/gl.dat. The variables you would use to set the segment naming formats for this file are GL_DAT_DATA_FMT and GL_DAT_INDEX_FMT.
Each of these variables 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 (lower case hexadecimal numbers), %X (uppercase hexadecimal numbers), and %o (octal numbers).
For example, setting environment variables GL_DAT_DATA_FMT=gl%d.dat and GL_DAT_INDEX_FMT=gl%d.idx 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. The index segments would be named /usr1/gl0.idx, /usr1/gl1.idx, /usr1/gl2.idx, and so forth.
The %d in the values of the filename-DATA-FMT and filename-INDEX-FMT variables 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: