


The easiest way to enable your applications to use AcuServer is to update the FILE-PREFIX and CODE-PREFIX runtime configuration variables to include paths with remote name notation. The ability of these variables to define multiple search paths makes them powerful tools for accessing both local and remote files.
To add a remote search path, simply append or insert the name and path of the remote directory to the variable's definition.
For example:
FILE-PREFIX . /usr/data @condor:/usr/data CODE-PREFIX . /usr/objects @condor:/usr/objects
In the preceding examples, whenever the application attempts to access a file, it will first look for the file in the current directory ("."), then in the local "/usr/data" or "/usr/objects" directory, and finally on file server "condor" in the directory "/usr/data" or "/usr/objects."
You can force these variables to be used even when your files are specified with absolute path names. FILE-PREFIX and CODE-PREFIX are usually not applied to file names that have full paths (those beginning with a "/" or a device name, such as: "c:"). However, if you set the APPLY-FILE-PATH or APPLY-CODE-PATH runtime configuration variables to "on" ("1", "true", "yes"), they will be applied to file names that begin with a "/" (forward slash). For example, if your application specifies the file:
/usr/bernie/data/ind.dat
and FILE-PREFIX is set to:
FILE-PREFIX @condor:
and APPLY-FILE-PATH is on, the runtime will attempt to access the file at:
@condor:/usr/bernie/data/ind.dat
APPLY-FILE-PATH and APPLY-CODE-PATH affect only file names beginning with a "/" (forward slash), and do not affect file names beginning with a device name (such as "c:").
If the application attempts to access a file in a location (path) that does not exist, the program will terminate displaying an error similar to the following:
File error 35 on SEQ1.DAT
(This error also appears if the runtime is not AcuServer-enabled.)
Note that the maximum length of FILE-PREFIX and CODE-PREFIX is restricted by a number of factors. The ACUCOBOL-GT runtimes restrict runtime configuration variables to a maximum of 1023 characters. The host operating system may restrict environment variables to less than 1023 characters (refer to your operating system documentation).