contents.gifindex.gifprev1.gifnext1.gif

1.5 Environment Variables

This manual often refers to the host machine's environment variables. These are values maintained by the host operating system that can be changed by the user. This is accomplished differently on different machines:

1. On MS-DOS and OS/2 machines, values can be assigned in the environment with the SET command. For example, to set the environment variable "SORT_DIR" to "C:\TEMP\", you would use the following line :

SET SORT_DIR=C:\TEMP\


Note that on DOS, the environment can hold only a limited number of variables before it fills up. Forward slashes (/) may be used in place of backslashes (\) on DOS. Upper-case and lower-case letters are interchangeable on DOS.

2. With Windows 3.1, use the procedure described above for DOS. However, be sure to execute the SET command before you start Windows.

3. With Windows NT, environment variables are set using the "System" applet in the Windows Control Panel.

4. With Windows 95, environment variables can be defined in the "autoexec.bat" (with the same syntax that's used with MS- DOS). Any changes made to the "autoexec.bat" file require restarting Windows 95 to take effect. Environment variables can be defined temporarily by booting to MS-DOS mode, defining variables with the SET command (again, as in MS-DOS) and then starting Windows. Variables defined in this way persist until the system is rebooted.

5. On UNIX systems, the environment is controlled in one of two fashions, depending on which command shell you are using. If you are using the Bourne shell ("sh") or the Korn shell ("ksh"), then you set a shell variable to the desired value and then export that variable. For example:

SORT_DIR=/tmp/; export SORT_DIR

If you are using the C-shell instead, then you use the setenv command. For example:

setenv SORT_DIR /tmp/

Upper-case and lower-case environment variables are distinct.

If you are using a different shell, see the documentation for that shell, or ask your system administrator.

6. On VAX/VMS systems, you set a symbol to the desired value. For example:

SORT_DIR == "$DISK1:[TEMP]"

Unlike UNIX, upper-case and lower-case variable names are treated the same on VMS.

7. AOS/VS and AMOS systems do not have user-definable symbols or an equivalent notation. On these machines, you must use other methods to accomplish the desired results. Virtually everything that can be specified via environment variables in ACUCOBOL-GT can be specified by an alternate method. See Book 4, Appendix H for configuration variables, and Chapter 2 of this manual for compiler and runtime options.