Chapter Contents |
Previous |
Next |
Environment Variables |
exec
function), program-scope environment
variables are considered case sensitive. For all other programs, these names
remain case insensitive for compatibility with CMS and previous releases.
exec
-linkage
programs, the original form of the variable is preserved even though the
case of an environment variable is not considered significant. (That is,
the variable
MyName
is stored as
MyName
, not as
myname
or
MYNAME
even though these are
all names for the same variable.) If a program calls
exec
to pass control to an
exec
-linkage
program, the called program receives the environment variables with their
original case information intact.
environ
. SAS/C now makes the program-scope environment variables accessible
by
environ
for all programs. However, variables
of other scopes are never accessible by
environ
. Similarly, when an
exec
function
is called, only the program-scope environment variables are passed to the
called program.
environ
and the list it addresses. SAS/C supports this modification
but does not recommend it. The POSIX.1a function
setenv
should be used to update the environment whenever possible.
In particular, you should not use both
setenv
and update
environ
simultaneously.
This is a restriction stated by the POSIX.1a draft standard.
environ
variable is not strictly ISO/ANSI conforming because
environ
is in the name space
reserved by ISO/ANSI
for users. For this reason, the name
environ
is accessible only to programs compiled with the
posix
option. Additionally, the name
environ
is valid only in the
main
load module of a program. To access
environ
from another load module, declare
extern char ***_environ;
and use
*_environ
in place of
environ
. This produces correct results in any
load module but is not portable.
_environ
can be used in programs that are not compiled with the
posix
option.
clearenv
function, which removes all environment variables. It has
an effect only on program-scope variables. That is, external- and permanent-scope
variables are unaffected.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.