Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Setting environment variables

You use environment variables to set values that programs need. Specify the value of an environment variable by using the SET command or by using the System Properties window. If you do not set an environment variable, either a default value is applied or the variable is not defined.

An environment variable defines some aspect of the user environment or a program environment that can vary. For example, you use the COBPATH environment variable to define the locations where the COBOL run time can find a program when another program dynamically calls it. Environment variables are used by both the compiler and runtime libraries.

In general, you set environment variables in either of two ways:

Some environment variables (such as COBPATH and NLSPATH) define directories in which to search for files. If multiple directory paths are listed, they are delimited by semicolons. For example, issuing the following command in a window sets the COBPATH environment variable to include two directories when you run programs from that window:

SET COBPATH=d:\cobdev\dll;d:\dev\dll

Paths that are defined by environment variables are evaluated in order, from the first path to the last. If multiple files with the same name are defined in the path of an environment variable, the first located copy of the file is used.

The value that you assign to an environment variable by using the SET command can include other environment variables or the variable itself. For example, assuming that COBPATH has already been set, you can add a directory to the value of COBPATH by issuing the following command:

SET COBPATH=%COBPATH%;d:\myown\dll;

related tasks
Setting environment variables for COBOL for Windows

related references
Compiler environment variables
Linker environment variables
Runtime environment variables


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)