Macro Statements |
Type: | Macro statement | ||
Restriction: | Allowed in macro definitions or open code | ||
See also: |
|
Syntax | |
Details | |
Comparisons |
Syntax |
%SYSEXEC<command>; |
puts you into operating environment mode under most operating environments, where you can issue operating environment commands and return to your SAS session.
is any operating environment command. If command contains a semicolon, use a macro quoting function.
Details |
The %SYSEXEC statement causes the operating environment to immediately execute the command you specify and assigns any return code from the operating environment to the automatic macro variable SYSRC. Use the %SYSEXEC statement and the automatic macro variables SYSSCP and SYSSCPL to write portable macros that run under multiple operating environments.
Operating Environment Information: These items related to the use of the %SYSEXEC statement are operating environment specific:
the availability of the %SYSEXEC statement in batch processing, noninteractive mode, or interactive line mode.
the way you return from operating environment mode to your SAS session after executing the %SYSEXEC statement with no argument.
the return codes you get in the automatic macro variable SYSRC.
For details, see the SAS documentation for your operating environment.
Comparisons |
The %SYSEXEC statement is analogous to the X statement and the X windowing environment command. However, unlike the X statement and the X windowing environment command, host commands invoked with %SYSEXEC should not be enclosed in quotation marks.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.