Previous Page | Next Page

Functions and CALL Routines

ENVLEN Function



Returns the length of an environment variable.
Category: SAS File I/O

Syntax
Arguments
Details
Examples

Syntax

ENVLEN(argument)


Arguments

argument

specifies a character variable that is the name of an operating system environment variable. Enclose argument in quotation marks.


Details

The ENVLEN function returns the length of the value of an operating system environment variable. If the environment variable does not exist, SAS returns -1.

Operating Environment Information:   The value of argument is specific to your operating environment.  [cautionend]


Examples

The following examples are for illustration purposes only. The actual value that is returned depends on where SAS is installed on your computer.

SAS Statements Results
   /* Windows operating environment */
x=envlen("PATH");
put x;

309
   /* UNIX operating environment */
y=envlen("PATH");
put y;
365
z=envlen("THIS IS NOT DEFINED");
put z;
-1

Previous Page | Next Page | Top of Page