SAS Macro Facility under Windows |
The behavior of the %SYSGET macro function is specific to Windows:
returns the character string that is the value of the Windows environment variable that is passed as the argument. Both Windows and SAS environment variables can be translated by using the %SYSGET function. A warning message is printed if the environment variable does not exist. The %SYSGET function has the following syntax:
%SYSGET(environment-variable-name); |
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 C:\winnt\system\command.exe
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.