As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
SYSRC automatic macro variable
- This is a Work in Progress. Please contribute to this article.
SYSRC automatic macro variable is populated with a return code that corresponds to any ERRORLEVEL value returned when an operating system command is executed by certain SAS statements. The value that SYSRC returns depends on the underlying operating system.
The default value of 0 is returned if no operating system command has been executed, or if an operating system command is executed asynchronously when the NOXSYNC system option is set.
The SYSRC automatic macro variable can be checked to determine if an operating system command has executed correctly. The check should be performed immediately after the SAS statement that executes the operating system command.
To display the SYSRC automatic macro variable in the log use the following macro code.
%PUT &=SYSRC. ;
Other language elements named SYSRC
SYSRC automatic macro variable should not be confused with the %SYSRC autocall macro that translates mnemonic text strings into return codes produced by SCL functions.
- CALL SYSTEM routine
- %SYSEXEC macro statement
- SYSTASK statement
- X statement
- XCMD system option
- XSYNC system option
- XWAIT system option
- X statement vs. CALL SYSTEM
- Tips:Use X Commands within a SAS Program to Issue Commands to Windows or MS-DOS
- Paper PO13 Applications for Running DOS Commands within SAS Na Li, Pharmacyclics, Sunnyvale, CA (2005)
- SYSRC Automatic Macro Variable: SAS(R) 9.4 Macro Language: Reference, Fourth Edition
- Running Windows or MS-DOS Commands from within SAS - SAS(R) 9.2 Companion for Windows, Second Edition