New function allows ILE programs to interact with Net.Data easily
The system language environment (DTW_SYSTEM), which allows users to call any program on the system, relies on the ability of the program that is being called to be able to get environment variables and set environment variables in order for the program to update Net.Data variables. Environment variables are character strings of the form "name=value" that are stored in an environment space outside of the program. The strings are stored in a temporary space associated with the job.
The SYSTEM language environment stores the parameters and their values specified on the %FUNCTION block in environment variables prior to invoking a program. Upon program completion, those parameters that are output parameters are obtained by SYSTEM language environment from the environment space and returned to Net.Data. Net.Data updates the parameters to reflect the new values.
In V3R2 and V3R7, ILE programs not written in C or C++ (C/C++ programs can use putenv() and getenv() UNIX-type APIs) could get environment variables by using the AS/400 HTTP server-supplied API QtmhGetEnv(). There was not a good, easy way for non C/C++ programs to set environment variables. PTFs
5716TC1 SF40954 (V3R7) and
5763TC1 SF40953 (V3R2) introduces a new API, QtmhPutEnv(), that will allow ILE programs to update environment variables.