An ENVIRONMENT statement has the following format:
ENVIRONMENT(type) library-name ([specification parameterN, ...)
Each ENVIRONMENT statement must be on a single line.
The following are the parameters you must specify for each language environment:
The name that associates this language environment with a FUNCTION block definition in a Net.Data macro. You use this name on a FUNCTION block definition to associate the function with the language environment. See the "Function Block" section in Net.Data Reference for more information about the FUNCTION block.
Important: The name cannot begin with the prefix DTW. This prefix is reserved for language environments shipped with Net.Data. If you use the DTW prefix, Net.Data cannot load your language environment DLL.
The name of the object containing the language environment interfaces that are called by Net.Data. The file extension is different for each operating system:
In SUN, PTX, and Linux, the name of the shared library is specified with the .so extension
Look at the initialization file shipped with Net.Data for your operating system to see how to specify this name. Consider using a fully qualified path name to make sure Net.Data finds the DLL or shared library.
The parameter passing specification that indicates whether Net.Data uses the parameter for input, output, or input and output. Possible values:
Specifies parameters that are passed to the language environment on each function call, in addition to parameters specified in the FUNCTION block definition and in the FUNCTION block RETURNS clause. They are passed in the parm_data_array field of the dtw_lei_t structure following the parameters specified in the FUNCTION block definition. You must define these parameters as variables in your Net.Data macro before the function call is made. If a function modifies the values of the output and input-output parameters, the parameters retain the modified value once the function finishes processing.
The following example shows an ENVIRONMENT statement for language environment called MY_LE.
ENVIRONMENT (MY_LE) lelib.dll ( IN INPUT1, OUT OUTPUT1 )
The ENVIRONMENT statement varies slightly for each operating system; for example, the parameters used in the SQL language environment on OS/390 differs slightly from the SQL language environment on UNIX.
ENVIRONMENT (DTW_SQL) DTWSQL ( IN LOCATION, DB2SSID, DB2PLAN ) ENVIRONMENT (DTW_SQL) /db2www/lib/dtwsqlshr.so ( IN DATABASE, LOGIN, PASSWORD )