Chapter Contents

Previous

Next
CALL SYSTEM

CALL SYSTEM



Issues operating system commands

UNIX specifics: Command must evaluate to a valid UNIX command


Syntax
Details
See Also

Syntax

CALL SYSTEM(command);


Details

The CALL SYSTEM routine issues operating system commands. Command can be a UNIX command enclosed in quotes, an expression whose value is a UNIX command, or the name of a character variable whose value is a UNIX command. The output of the command appears in the window from which you invoked the SAS System.

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.  [cautionend]

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;

See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.