Put environment variable with CCSID (QzsrPutEnvCCSID) API

The QzsrPutEnvCCSID() API allows a CGI program to set or create a job-level environment variable. CCSID support allows you to specify the encoding of the environment string.

Required parameter group:
Environment string Input Char(*)
Lenth of environment string Input Binary(4)
CCSID of environment string Input Binary(4)
Error code I/O Char(*)

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. They are both case sensitive. The QzsrPutEnvCCSID() API expects this value to be in the CCSID of the environment string.

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.

CCSID environment string
INPUT:BINARY(4)
The CCSID to be used for the encoding of the environment string. The valid values for this parameter are:
  • 0 : The CCSID of the environment string.
  • 1-65533 : A valid CCSID in this range must be specified or an error is returned.
Error code
I/O:CHAR(*)

The structure in which to return error information. Error messages are added to the error log or script log except for those listed below. For the format of the structure and for details on how to process API errors, see the API error reporting topic in the IBM® i Information Center.

Error messages

CPF24B4 E
Severe error while addressing parameter list.
CPF3CF1 E
Error code parameter not valid.
Note: The Environment Variable APIs provide the putenv() (Put Value in Environment Variable) function necessary to set (or create and set) an environment variable. Programs that need CCSID conversion support for environment variables should use the QzsrPutEnvCCSID() API. See also Get environment variable with CCSID (QzsrGetEnvCCSID) API.