Macro Statements in UNIX Environments

The arguments that can be entered with the following statements depend on the operating environment:
%SYSEXEC
executes UNIX commands. It is similar to the X statement described in Executing Operating System Commands from Your SAS Session. The %SYSEXEC statement enables you to execute operating environment commands immediately and, if necessary, determine whether they executed successfully by examining the value of the automatic macro variable SYSRC. You can use the %SYSEXEC statement inside a macro or in open code. The form of the %SYSEXEC statement is as follows, where command can be any UNIX command:
%SYSEXEC <command>;
For example, the following code writes the status of the default printer to your UNIX shell:
%sysexec lpstat;
Entering %SYSEXEC without a UNIX command starts a new shell, except under the X interface to SAS. For more information, see Executing Operating System Commands from Your SAS Session.