Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Appendix

File Name Handling

Naming Conventions and File Extensions

Limitations

Environment Variables

Passing Multiple File Names

Using Operating System Commands as Arguments

Examples

 

Appendix

 

 

File names can be used throughout Omnidex to point to files containing information pertinent to the immediate task. From declaring the physical location of data files in an Omnidex Environment file to passing a USE file for testing an application in ODXSQL, Omnidex offers several options for using and passing physical file names.

 

Naming Conventions and File Extensions

Omnidex uses a standard set of file extensions, suffixes, when dealing with file types specific to the software, some required and some optional. Following is a list of required and recommended file extensions:

Unix
Windows NT/2000/XP

Environment source file - Recommended, assumed if omitted.

filename.src

filename.src

Omnidex Environment File (Compiled Environment Source File) - Recommended, assumed if omitted.

filename.env

filename.env

Installation batch file
Index build script

passed to DBINSTAL at the command line. Recommended.

filenamein

filenamebld

filename.in

filename.bld

Installation batch file
Index build script

run as a shell script. Recommended.

filenamein.sh

filenamebld.sh

filenamein.bat

filenamebld.bat

Tab-Delimited Files (TDF). Recommended.

filename.tdf

filename.tdf

Omnidex Stand-Alone Tables (OST). Required.

filename.ost

filename.ost

Omnidex Offest Index files. Required.

filename.ofx

filename.ofx

Data files

filename.dat

filename.dat

SQL files

filename.sql

filename.sql

Log files

filename.log

filename.log

DISC also recommends the following directory structure for Omnidex environments:

Environment home directory for environment source, environment catalog, installation and build scripts.

ENVIRONMENT_HOME

ENVIRONMENT_HOME

Data files directory

ENVIRONMENT_HOME/dat

ENVIRONMENT_HOME\dat

Index files directory

ENVIRONMENT_HOME/idx

ENVIRONMENT_HOME\idx

SQL script directory

ENVIRONMENT_HOME/sql

ENVIRONMENT_HOME\sql

Log file directory

ENVIRONMENT_HOME/log

ENVIRONMENT_HOME\log

 

Limitations

  • Each filespec, including the full path and file name, is limited to 255 characters in length. This is a POSIX standard.
  • Where multiple files are allowed, there is no limit as to the number of files passed, as long as each individual filespec adheres to the 255 character limit.
  • When using environment variables, the output of the translation of the environment variable is limited to 255 characters.
  • INDEXPREFIX filespecs are limited to 253 characters because Omnidex appends two characters to the file name.

 

 

Environment Variables

Environment variables can be used anywhere that file names are used. They can be passed in place of, or in conjunction with, a file name.

Omnidex supports operating system syntax as well as its own, universal syntax, for using environment variables.

For example, assume the environment variable APPLICATION_HOME has been set to point to the main application directory on a server. The syntax to reference that environment variable, in the INDEXPREFIX declaration in the Omnidex Environment file for example, is as follows:

Windows Syntax

INDEXPREFIX "%APPLICATION_HOME%\idx\orders"

UNIX Syntax

INDEXPREFIX "$APPLICATION_HOME/idx/orders"

Omnidex Syntax

INDEXPREFIX "{$APPLICATION_HOME/idx/orders}"

This last example will translate the line to the proper operating system syntax.
You cannot use system commands when using the Omnidex Syntax.

 

 

 

Passing Multiple File Names

Omnidex supports the use of multiple files in some places like the PHYSICAL clause of the TABLE statement in the Omnidex Environment file. Multiple file names can be passed in two ways:

  • using a wildcard character
  • using a comma-separated list of files

Wildcard Character

The syntax for passing multiple file names with a wildcard card character is much like the operating system syntax. Each file must adhere to the 255 character length limit, however, there is no limit to the number of files that can be included with this wildcard character.

For example, assume there are several .dat files in the same directory, they can be referenced by:

data/*.dat

data/sales*.dat

sales2003.*

*.*

Comma-Separated List

Multiple files can be passed using a comma-separated list of file names. Each file spec must adhere to the 255 character length limit, however, there is no limit to the number of files that can be passed in the comma-separated list. The file list can span multiple lines and can include carriage returns.

PHYSICAL "data/sales1.dat,data/sales2.dat,data/sales3.dat,data/sales4.dat"

 

System Commands

Omnidex supports the use of system commands as an argument. The output of the system command will be used as the argument value. Passing environment variables is one example of using system commands in an argument.

Another example would be to use the contents of a file. For example, the default user name can be stored in a file (username.txt) and passed using the cat or type system command.

USER "type username.txt"

The contents of username.txt are used at the USER argument.

 

Examples

Environment Variables

In this example, you want to make Omnidex put all of the Omnidex index files into the idx sub-directory of the main application directory, c:\omnidex, and prefix these index files with the filename "orders".

In this example, an environment variable called APPLICATION_HOME points to this main application directory. You'll set the INDEXPREFIX clause of the DATABASE statement in the Omnidex Environment file to use this environment variable, as follows:

INDEXPREFIX "%APPLICATION_HOME%\idx\orders"

This will cause all of the index files to be created as follows:

c:\omnidex\idx\orders0A
c:\omnidex\idx\orders0B
c:\omnidex\idx\orders0C
...

The above example is on a Windows machine, however, the same can be accomplished on a Unix machine using Unix syntax.

Multiple Environment Variables can be concatenated together to form a single argument value. For example, assume the following environment variables have been set:

APPLICATION_HOME = "/usr/omnidex/"
DATA_FILES = "datafiles/currentyear/"
SALES_DATA = "sales.dat"

The PHYSICAL clause of the TABLE section in the Omnidex Environment file can look like this:

PHYSICAL "{$APPLICATION_HOME$DATA_FILES$SALES_DATA}"

Multiple Files Using a Wildcard Character

In this example, there are several .dat files located in the data subdirectory of the application's home directory. These .dat files are going to be defined together as a single table Physical clause of the Table section in the Omnidex Environment file.

TABLE Sales
PHYSICAL "{$APPLICATION_HOME/data/*.dat}"

Multiple Files Using a Comma-Separated List of Files

The previous example can also be accomplished by concatenating all of the filenames together into a comma-separated list.

TABLE Sales
PHYSICAL {"data/january.dat,data/february.dat,data/march.dat,data/april.dat,
data/may.dat,data/june.dat,data/july.dat,data/august.dat,data/september.dat,
data/october.dat,data/november.dat,data/december.dat"}

 

 

Top