Put Environment Variable (QtmhPutEnv) API

Important: Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . It is recommended that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm Link outside Information Center for more information.
Required Parameter Group:
1 Environment string Input Char(*)
2 Length of environment string Input Binary(4)
3 Error Code I/O Char(*)

The QtmhPutEnv API allows you to set or create a job-level environment variable. This is useful for communication between programs running in the same job, such as your program and the Net.Data® language environment DTW_SYSTEM.

Required parameter group

Environment string
INPUT:CHAR(*)

The input string of the form: ″envVar=value″. Where ″envVar″ is the name of the new or existing environment variable, and ″value″ is the value you want to set the environment variable. Note that they are both case sensitive. The server expects this value to be in the CCSID of the job.

Length of environment string
INPUT:BINARY(4)

The input variable that contains the length of the environment string parameter (without trailing blanks). For example, the length of the environment string ″envVar=value″ is twelve.

Error Code
I/O:CHAR(*)

The structure in which to return error information. For the format of the structure and for details on how to process API errors, see the API error reporting topic in the iSeries™ Information Center.

Error messages

CPF24B4 E
Severe Error while addressing parameter list.
CPF3021 E
The value specified for the argument is not correct.
CPF3C17 E
Error occurred with input data parameter.
CPF3CF1 E
Error code parameter not valid.
CPF3408 E
The address used for an argument is not correct.
CPF3460 E
Storage allocation request failed.
CPF3474 E
Unknown system state.
CPF3484 E
A damaged object was encountered.
Note: The Environment Variable APIs provide the putenv() (Put Value in Environment Variable) function necessary to set (or create and set) an environment variable. Therefore, programs written in ILE C do not need to use the QtmhPutEnv() API. This API, for ILE C, is more difficult to use (and is slower) than the putenv() API on which it is based.

Programs that need CCSID conversion support for environment variables should use the Put environment variable with CCSID (QzsrPutEnvCCSID) API.