Chapter Contents


SAS Companion for the Microsoft Windows Environment

Macro Functions

The behavior of the %SYSGET macro function is specific to Windows:

returns the character string that is the value of the Windows environment variable passed as the argument. Both Windows and SAS environment variables can be translated using the %SYSGET function. A warning message is printed if the environment variable does not exist. The %SYSGET function has the following syntax:


Here is an example of using the %SYSGET function:

%let var1=%sysget(comspec);
%put The COMSPEC environment variable 
     is &var1;
The following line is written to the SAS log:
The COMSPEC environment variable is 

Chapter Contents



Top of Page

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