Dynamically changes the value of an environment variable.
#include cobenv.h"
int cobputenv (const cobchar_t *envstr);
envstr | The null terminated string to be placed into the environment. |
The environment string envstr is put into the environment. By convention, environment strings have the format:
NAME=VALUE
but the run-time system does not check that envstr is in this format.
This function ultimately passes envstr into the C library function putenv(), which puts envstr into the operating system environment.
This function returns a value of zero if the operation was successful; any other value indicates an unsuccessful operation. Illegal environment names lead to undefined results.
display name upon environment-name display value upon environment-value
The following code shows how to set $ABC to XYZ:
cobputenv("ABC=XYZ");