Chapter Contents

Previous

Next
%SYSGET

%SYSGET



Returns the value of the specified operating environment variable

Type: Macro function


Syntax
Details
Example
Using SYSGET in a UNIX Operating Environment

Syntax

%SYSGET(environment-variable)

environment-variable
is the name of an environment variable. The case of environment-variable must agree with the case that is stored on the operating environment.


Details

The %SYSGET function returns the value as a character string. If the value is truncated or the variable is not defined on the operating environment, %SYSGET displays a warning message in the SAS log.

You can use the value returned by %SYSGET as a condition for determining further action to take or parts of a SAS program to execute. For example, your program can restrict certain processing or issue commands that are specific to a user.

For details, see the SAS documentation for your operating environment.


Example

Example 1: Using SYSGET in a UNIX Operating Environment

This example returns the id of a user on a UNIX operating environment:

%let person=%sysget(USER);
%put User is &person;

Executing these statements for user ABCDEF prints this in the SAS log:

User is abcdef


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.