_CEE_RUNOPTS
Used to specify invocation Language Environment® runtime
options for programs invoked using one of the exec family of functions.
Mechanisms for setting the value of the _CEE_RUNOPTS environment
variable include using the export command within
the z/OS®
UNIX shell,
or using the setenv() or putenv()
functions within a C/C++ application. The runtime options set from
the _CEE_RUNOPTS environment variable value that
become active in the invoked program are known as invocation
command runtime options.
value is a null-terminated character string of Language Environment runtime options. _CEE_RUNOPTS=value For example, you could specify the following to set the value of the environment variable within the z/OS UNIX shell. export _CEE_RUNOPTS="stack(,,any,) termthdact(dump)" The _CEE_RUNOPTS environment variable has a unique behavior. It can be unset, or modified, but will be re-created or added to across an exec to effect the propagation of invocation Language Environment runtime options. This behavior is designed specifically to allow runtime options such as TRACE to take effect
for parts of an application which are not invoked directly by the
user. Without this behavior, the external TRACE option
could not be propagated to parts of an application that are executed
using one of the exec family of functions.
At the time of the exec, any active invocation
command runtime option settings, not already explicitly part of the _CEE_RUNOPTS environment
variable, are added to its value. This new value for the _CEE_RUNOPTS environment
variable is passed to the exec target to be used
as invocation Language Environment runtime
options for the invoked program. Thus, all invocation runtime options,
those specified with the _CEE_RUNOPTS environment
variable and those already active, are propagated across the exec.
When the _CEE_RUNOPTS environment variable is
not defined at the time of the exec, but there are
other active invocation command runtime options, it will be re-created
with its value set to represent the active invocation command runtime
option settings. This unique behavior, where the _CEE_RUNOPTS environment
variable is added to, or re-created, across an exec,
can cause unexpected results when the user attempts to unset (clear)
the environment variable, or modify its value.
exec family of functions.
The propagation of the _CEE_RUNOPTS environment variable
takes place across creation of the sub-shell. /u/carbone>echo $_CEE_RUNOPTS
POSIX(ON) 1
/u/carbone>/bin/sh 2
/u/carbone>echo $_CEE_RUNOPTS 3
POSIX(ON)
/u/carbone>unset _CEE_RUNOPTS 4
/u/carbone>echo $_CEE_RUNOPTS
/u/carbone>env | grep _CEE_RUN 5
_CEE_RUNOPTS=POS(ON)
/u/carbone>echo $_CEE_RUNOPTS 6
/u/carbone>export _CEE_RUNOPTS="ABTERMENC(RETCODE)" 7
/u/carbone>echo $_CEE_RUNOPTS
ABTERMENC(RETCODE)
/u/carbone>env | grep _CEE_RUN 8
_CEE_RUNOPTS=ABTERMENC(RETCODE) POS(ON)
/u/carbone>/bin/sh 9
/u/carbone>echo $_CEE_RUNOPTS
ABTERMENC(RETCODE) POS(ON)
/u/carbone>unset _CEE_RUNOPTS
/u/carbone>echo $_CEE_RUNOPTS
/u/carbone>env | grep _CEE_RUN
_CEE_RUNOPTS=ABT(RETCODE) POS(ON)
/u/carbone>
- The current value of the
_CEE_RUNOPTSenvironment variable happens to be POSIX(ON). - Using /bin/sh to create a sub-shell will go through the process
where the
_CEE_RUNOPTSenvironment variable is added to, or re-created, across the exec. - Displaying the value of the
_CEE_RUNOPTSenvironment variable using echo in the sub-shell shows that no other invocation command runtime options were in effect at the time of the exec, since the value of the environment variable is unchanged (there were no runtime options to add). - Using
unsetto clear the_CEE_RUNOPTSenvironment variable does remove it from the sub-shell environment, as shown with theechocommand, but it does not change the fact that POSIX(ON) is the active invocation command runtime option in the sub-shell. - To see this, we use the
env | grep_CEE_RUNOPTScommand. Theenvis the target of anexec. We know that the_CEE_RUNOPTSenvironment variable is re-created across the exec from the active invocation command runtime options. And as you can see, the value shows asPOS(ON). During re-creation, Language Environment uses the minimum abbreviations for the runtime options when re-creating or adding to the_CEE_RUNOPTSenvironment variable. - When the
envreturns, the_CEE_RUNOPTSenvironment variable is still unset in the sub-shell as seen using theechocommand. - We now use export to set a different value for the
_CEE_RUNOPTSenvironment variable in the sub-shell. We see the value using the echo command. - Using the env | grep
_CEE_RUNOPTScommand again, we see the behavior where the active invocation command runtime options are added to the current value of the_CEE_RUNOPTSenvironment variable. - The rest of the example creates a second sub-shell and shows that
the
_CEE_RUNOPTSenvironment variable in the sub-shell was added to across theexecof the sub-shell. And again, usingunsetdoes not change the active invocation command runtime options.