z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


environment()

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-environment--(--variable name--+--------------+--)----------><
                                  '-,--new value-'      

Read syntax diagramSkip visual syntax diagram
>>-environment--(--variable name--+-----------------+--)-------><
                                  '-,--,--operation-'      

Function

Queries and alters environment variables. The stem __environment. is not altered through this service. That stem contains the environment variables on entry to the REXX program, and is available for your use. Alterations of the environment are used on subsequent calls to the stream popen command and ADDRESS SH.

Parameters

variable name
The name of the environment variable to operate on. If this is the only argument specified, the value of the variable is returned and the variable is not affected.
new value
A string to replace the value of variable name. The previous value of the variable is returned.
operation
An optional argument that specifies the operation to be performed. Only the first character is significant. The values can be:
exists
Tests the existence of the variable. The function returns 1 if the variable is defined, and 0 if it is not defined.
delete
Deletes the variable from the environment, if it exists. The function returns 0 if the variable is successfully deleted, and 1 if the variable is not defined.

Example

To get the value of the PATH environment variable:
path=environment('PATH')  
To reset PATH to the current directory:
call environment 'PATH','.' 
To delete the PATH environment variable:
call environment 'PATH',,'d'  

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014