Chapter Contents

Previous

Next
CALL SYSTEM

CALL SYSTEM



Issues an operating environment command during a SAS session

OS/390 specifics: all


Syntax
Details
See Also

Syntax

CALL SYSTEM(command);

command
can be a system command enclosed in quotes, an expression whose value is a system command, or the name of a character variable whose value is a system command. Under OS/390, "system command" includes TSO commands, CLISTs, and REXX execs.


Details

The CALL SYSTEM routine is similar to the X (or TSO) statement, the X (or TSO) command, the SYSTEM (or TSO) function, and the %SYSEXEC (or %TSO) macro statement.

In most cases, the X statement, the X command, or the %SYSEXEC macro statement are preferable because they require less overhead. However, the CALL SYSTEM routine can be useful in certain situations because it is executable and because it accepts expressions as arguments. For example, the following DATA step executes one of three CLISTs depending on the value of a variable named ACTION that is stored in an external file named USERID.TRANS.PROG:

data _null_;
  infile 'userid.trans.prog';

  /* action is assumed to have a value of    */
  /*    1, 2, or 3                           */
  /* create and initialize a 3-element array */
  input action;
  array programs{3} $ 11 c1-c3
    ("exec clist1" "exec clist2" "exec clist3");
  call system(programs{action});
run;

In this example, the array elements are initialized with character strings that consist of TSO commands for executing the three CLISTs. In the CALL SYSTEM statement, an expression is used to pass one of these character strings to the CALL SYSTEM routine. For example, if ACTION equals 2, then PROGRAMS{2}, which contains the EXEC CLIST2 command, is passed to the CALL SYSTEM routine.

Under OS/390, CALL TSO is an alias for the CALL SYSTEM routine.

See Also


Chapter Contents

Previous

Next

Top of Page

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