SAS Macro Facility under Windows |
The following automatic macro variables have values that are specific to Windows:
contains the current SAS condition code that SAS returns to Windows when SAS exits. Upon exit, SAS translates this condition code to a return code that has a meaningful value for the operating environment.
Note: When ERRORCHECK=NORMAL, the return code will be 0 even if an error exists in a LIBNAME or FILENAME statement, or in a LOCK statement in SAS/SHARE software. Also, the SAS job or session will not end when the %INCLUDE statement fails due to a nonexistent file. For more information, see the ERRORCHECK= system option in the SAS Language Reference: Dictionary
gives the name of the current graphics device. The current graphics device is determined by the DEVICE system option. Contact your on-site SAS support personnel to determine which graphics devices are available at your site. For information about the DEVICE system option, see DEVICE System Option: Windows and SAS Language Reference: Dictionary.
returns a number that uniquely identifies the SAS task under Windows.
returns the maximum long integer value that is allowed under Windows, which is 2,147,483,647.
holds the Windows status of Windows commands that are issued during your SAS session. The variable holds a character string that is the text form of the decimal value of the Windows command status.
For example, consider the following statements:
options noxwait; x 'dirf'; /* Invalid Windows command */ %put This Windows status is &sysrc; x 'dir'; /* Valid Windows command */ %put The corrected Windows status is &sysrc;The following lines are written to the SAS log:
This Windows status is 1 The corrected Windows status is 1
The OPTIONS statement turns the XWAIT option off so that the Windows command prompt window closes automatically. You do not have to type exit to return to your SAS session. The value of "This Windows status is" will be 1, and the value for "The corrected Windows status is" will be 1. If you run this example with the XWAIT option, you would need to type exit before SAS would run the code. After you type exit, a value of 9009 is returned for the statement "This Windows status is", and 0 is the value for "The corrected Windows status is". If you use the NOXSYNC system option, the value of SYSRC is automatically 0.
returns the name of the specific Windows environment that you are using. The possible return values are
Microsoft Windows 2008 Datacenter Server
Microsoft Windows 2008 Enterprise Server
Microsoft Windows Server 2008
Microsoft Windows Vista or Windows 7
Microsoft Windows Vista x64 or Windows 7 x64
Microsoft Windows Server 2003 Enterprise 64-bit Edition for Itanium-based computers
Microsoft Windows Server 2003 Datacenter 64-bit Edition for Itanium-based computers
Microsoft Windows Server 2008 Datacenter 64-bit edition for Itanium-based computers
Microsoft Windows Server 2008 Enterprise 64-bit edition for Itanium-based computers
Microsoft Windows Server 2008 Standard 64-bit edition for Itanium-based computers
Microsoft Windows Server 2003 Datacenter 64-bit edition for x64 based computers
Microsoft Windows Server 2003 Enterprise 64-bit edition for x64 based computers
Microsoft Windows Server 2003 Standard 64-bit edition for x64 based computers
Microsoft Windows Server 2008 Datacenter 64-bit edition for x64-based computers
Microsoft Windows Server 2008 Enterprise 64-bit edition for x64-based computers
Microsoft Windows XP Professional x64 edition
Microsoft Windows Server 2008 Standard 64-bit edition for x64-based computers
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.