Automatic Macro Variables

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 is 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 does not end when the %INCLUDE statement fails due to a nonexistent file. For more information, see the ERRORCHECK= system option in SAS System Options: Reference.
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 System Options: Reference.
can contain the values FORE or BACK under Windows. If you are running EG on Windows, the value of SYSENV is BACK.
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 0
The OPTIONS statement turns the XWAIT option off so that the Windows command prompt window closes automatically. You do not have to enter exit to return to your SAS session. The value of “This Windows status is” is 1, and the value for “The corrected Windows status is” is 0. If you run this example with the XWAIT option, you would need to enter exit before SAS would run the code. After you enter 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 operating environment abbreviation WIN.
returns the name of the specific Windows environment that you are using. Here are the possible return values:
Microsoft Windows 8.1 Home
W32 81PRO
Microsoft Windows 8.1 Professional
Microsoft Windows 10 Home
Microsoft Windows 10 Professional
Microsoft Windows 8.1 Home
Microsoft Windows 8.1 Professional
Microsoft Windows 10 Home
Microsoft Windows 10 Professional
Windows Server 2012 R2 Foundation
Windows Server 2012 R2 Essentials
Windows Server 2012 R2 Standard
Windows Server 2012 R2 Datacenter