DTW_GETENV

AIX HP-UX Linux OS/2 OS/390 OS/400 PTX 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 37. 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 38. DTW_GETENV Return Codes
Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1003 An incorrect number of parameters were passed on a function call.
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

<p>The server is @DTW_rGETENV("SERVER_PROTOCOL").</p>

Returns:

The server is "HTTP/1.0".


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