The CALL SYSTEM routine
issues operating system commands. The output of the command appears
in the window from which you invoked SAS.
The value of the XSYNC
system option affects how the CALL SYSTEM routine works.
Note: The CALL SYSTEM routine can
be executed within a DATA step. However, neither the X statement nor
the %SYSEXEC macro program statement is intended for use during the
execution of a DATA step.
In the following example,
for each record in
answer.week
, if the
resp
variable
is
y
, the CALL SYSTEM routine will mail a
message:
data _null_;
set answer.week;
if resp='y' then
do;
call system('mail mgr < $HOME/msg');
end;
run;