ContentsIndexPreviousNext

4.3.1.1 CODE-PREFIX

If desired, you can use the CODE-PREFIX variable to define the location of the object programs being CALLed. In a client/server environment, the CODE-PREFIX variable can be defined as follows:

CODE-PREFIX . /usr/prog1 *servername:/usr/prog2

where prog1 and prog2 are the directories containing the ACUCOBOL-GT object code (for example, "prog1.acu" and "prog2.acu"). In this example, whenever the client application tries to access a program's object code, it will first look for the code in the current directory ("."), then in the local "/usr/prog1" directory, and finally on the remote application server "servername" in the directory "/usr/prog2".

Because AcuConnect supports Transmission Control Protocol/Internet Protocol (TCP/IP), it can also be used to launch application processes over the Internet. In an Internet environment, the "servername" portion of CODE-PREFIX would be the name of the application server on the Internet.

Notice that the remote server name is preceded by the character, "*". The asterisk indicates that the program is located on the server and must be run on the server as well.

When the client COBOL program executes a CALL, it verifies which directory contains the program (by looking in CODE-PREFIX), and executes the program either on the client or the server.


Note: When you use CODE-PREFIX to specify the location of your CALLed program, the runtime traverses the specified paths to locate the resource. If you use this method, try to place remote notations towards the end of the file. Generally, you achieve better performance by defining a code name alias, because remote machines do not need to be searched using this method.
This architecture allows most existing COBOL programs to operate in a true distributed environment without any code modification. You can simply install AcuConnect and modify the "client.cfg" file according to your needs. Even the parameter transfer is performed following standard COBOL procedures (the USING clause after the CALL command).

Note that the object program can be executed both in stand-alone and client/server mode, operating only on external parameters.

For example, in a stand-alone environment, CODE-PREFIX could be defined as follows in Windows systems:

CODE-PREFIX c:\prog1;c:\prog2

And as the following in UNIX systems:

CODE-PREFIX /usr/prog1:/usr/prog2