On Wed, 4 Oct 2023 16:06:38 +0000, Farley, Peter wrote:

>Perform setenv(). Adds, changes, or deletes an environment variable in the 
>environment list.
>
>OK, it says “set” env not “put” env.  Semantics appear the same.
>
No.  Single Unix says:
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/putenv.html#tag_16_466_03>
    ..., the string pointed to by string shall become part of the environment,
    so altering the string shall change the environment.

And OMvS says (less clearly, IMO):
<https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-putenv-change-add-environment-variable>
    Note: Starting with, z/OS® V1R2, the storage used to define the environment
    variable pointed to by envvar is added to the array of environment 
variables. 

This is not true for setenv(), which makes a copy of the value.

>That environment variable _EDC_PUTENV_COPY seems intended to permit an 
>obsolete storage location (pre-z/OS V1R2 it says) for environment variables.  
>Why would you want that?
>
IBM provided the option for users who had come to depend on the non-standard
behavior, which they considered more intuitive.

-- 
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to