An environment variable is a name that is associated with a string of characters and that defines some variable aspect of the program environment. You use environment variables to set values that programs, including the compiler, need.
Set the environment variables for the compiler by using the export command. For example, to set the SYSLIB variable, issue the export command from the shell or from a script file:
export SYSLIB=/u/mystuff/copybooks
The value that you assign to an environment variable can include other environment variables or the variable itself. The values of these variables apply only when you compile from the shell where you issue the export command. If you do not set an environment variable, either a default value is applied or the variable is not defined. The environment-variable names must be uppercase.
The environment variables that you can set for use by the compiler are as follows:
export COBOPT="TRUNC(OPT) XREF"
For COPY statements in which you have not coded an explicit library-name, the compiler searches for copybooks in this order:
related tasks
Specifying compiler options under UNIX
Compiling and linking with the cob2 command
Setting and accessing environment variables
related references
Compiler-directing statements
Compiler options
COPY statement (Enterprise COBOL Language Reference)