z/OS Language Environment Customization
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


ENVAR

z/OS Language Environment Customization
SA38-0685-00

Derivation: ENvironmental VARiables

ENVAR sets the initial values for the environment variables that can later be accessed or changed using the C functions getenv(), putenv, setenv, and clearenv.

The set of environment variables established by the end of run-time option processing reflects all the various sources where environment variables are specified, rather than just the one source with the highest precedence. However, if a setting for the same environment variable is specified in more than one source, the setting with the highest precedence is used.

The system() function can be used to create a new environment. Environment variables in effect at the time of the POSIX system() call are copied to the new environment. The copied environment variables are treated the same as those found in the ENVAR run-time option on the command level.

When you specify the RPTOPTS run-time option, the output for the ENVAR runtime option contains a separate entry for each source where ENVAR was specified with the environment variables from that source.

Non-CICS default
ENVAR=((''),OVR)
CICS® default
ENVAR=((''),OVR)
AMODE 64 default
ENVAR=((''),OVR)
Read syntax diagramSkip visual syntax diagram
Syntax

                   .-,----------.                        
                   V            |        .-OVR----.      
>>-ENVAR--=--(--(------string---+--)--,--+-NONOVR-+--)---------><

string
Is of the form name=value, where name and value are sequences of characters that do not contain null bytes or equal signs. The string name is an environment variable, and value is its value.

Blanks are significant in both the name= and the value characters.

You can enclose the string in either single or double quotation marks to distinguish it from other strings. The string cannot contain DBCS characters. It can have a maximum of 250 characters.

You can specify multiple environment variables, separating the name=value pairs with commas. Quotation marks are required when specifying multiple variables.

OVR
Specifies that the option can be overridden.
NONOVR
Specifies that the option cannot be overridden.

z/OS® UNIX considerations

The environment variables apply to the enclave.

Usage notes

The ENVAR option functions independently of the POSIX runtime option setting.

C considerations
An application can access the environment variables using C function getenv or the POSIX variable environ, which is defined as:
    extern char **environ;

Access through getenv is recommended, especially in a multithread environment.

HLLs can access the environment variables through standard C functions at enclave initialization and throughout the application's run. Access remains until the HLL returns from enclave termination. Environment variables that are propagated across the EXEC override those established by the ENVAR option. getenv serializes access to the environment variables.

C++ considerations
An application can access the environment variables using C function getenv.

HLLs can access the environment variables through standard C functions at enclave initialization and throughout the application's run.

For more information

For more information about the RPTOPTS runtime option, see RPTOPTS.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014