IBM Books

Net.Data Administration and Programming Guide for OS/400

Environment Configuration Statements

An ENVIRONMENT statement configures a language environment. A language environment is a component of Net.Data that Net.Data uses to access a data source such as a DB2 database or to execute a program written in a language such as REXX. Net.Data provides a set of language environments, as well as an interface that allows you to create your own language environments. These language environments are decribed in Using Language Environments and the language environment interface are described in Net.Data Language Environment Reference.

Net.Data requires that an ENVIRONMENT statement exist in the Net.Data initialization file for a language environment before you can invoke the language environment.

Net.Data specifies several variables that affect the way in which Net.Data language environments interpret calls to functions that are defined in FUNCTION blocks. The settings of these variables must be passed to a language environment to have an effect.

For example, a macro can define a DATABASE variable to specify the name of a database at which an SQL statement within a DTW_SQL function is to be executed. The value of DATABASE must be passed to the SQL language environment (DTW_SQL) so that the SQL language environment can connect to the designated database. To pass the variable to the language environment, you must add the DATABASE variable to the parameter list of the environment statement for DTW_SQL.

The sample Net.Data initialization file makes several assumptions about customizing the setting of Net.Data environment configuration statements. These assumptions may not be correct for your environment. Modify the statements appropriately for your environment.

To add or update an ENVIRONMENT statement:

ENVIRONMENT statements have the following syntax:

ENVIRONMENT(type) library_name (parameter_list, ...) 

Parameters:

When Net.Data processes the INI file, it does not load the language environment service programs. Net.Data loads a language environment service program when it first executes a function that identifies that language environment. The service program then remains loaded for as long as Net.Data is loaded.

Example: ENVIRONMENT statements for Net.Data-provided language environments

When customizing the ENVIRONMENT statements for your application, add the variables on the ENVIRONMENT statements that need to be passed from your initialization file to a language environment or that Net.Data macro writers need to set or override in their macros.

1  MACRO_PATH    /WWW/MACRO;/QSYS.LIB/WWW.LIB/MACRO.FILE
2  INCLUDE_PATH  /WWW/MACRO;/QSYS.LIB/WWW.LIB/MACRO.FILE
3  EXEC_PATH     /QSYS.LIB;/QSYS.LIB/WWW.LIB
 
4  ENVIRONMENT(DTW_REXX) /QSYS.LIB//QTCP.LIB/QTMHREXX.SRVPGM ( )
5  ENVIRONMENT(DTW_SQL)  /QSYS.LIB/QTCP.LIB/QTMHSQL.SRVPGM (IN DATABASE,
     LOGIN, PASSWORD, TRANSACTION_SCOPE, SHOWSQL, DB_CASE, 
     RPT_MAX_ROWS, START_ROW_NUM, DTW_SET_TOTAL_ROWS, 
     OUT DTWTABLE, SQL_CODE, TOTAL_ROWS)
6  ENVIRONMENT(DTW_SYSTEM) /QSYS.LIB/QTCP.LIB/QTMHSYS.SRVPGM  ( )

Each ENVIRONMENT statement must be on a single line.


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