IBM Books

Reference

DTW_GETENV


AIX HP-UX Linux OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X X

Purpose

Returns the value of the specified environment variable.

Format

@DTW_GETENV(envVarName, envVarValue)

@DTW_rGETENV(envVarName)

Parameters

Table 35. DTW_GETENV Parameters

Data Type Parameter Use Description
string envVarName IN A variable or literal string.
string envVarValue OUT The value of the environment variable specified in envVarName. A null string is returned if the value is not found.

Return Codes

Table 36. DTW_GETENV Return Codes

Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1003 The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function.
1005 A parameter passed on a function call, required to be a string variable, was of a different variable type.
1006 A literal string was passed on a function call for a parameter which was required to be an output parameter.

Usage Notes

You can also use the ENVVAR statement to reference the values of environment variables. For more information, see ENVVAR Statement.

Examples

Example 1: Returns the value for the PATH statement on the OUT parameter

@DTW_GETENV(myEnvVarName, myEnvVarValue)

Example 2: Returns the value for the PATH statement

@DTW_rGETENV(myPath)

Example 3: Returns the value for the protocol of the server

The server is @DTW_rGETENV("SERVER_PROTOCOL").


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]