Previous Page | Next Page

Functions and CALL Routines under z/OS

CALL SYSTEM Routine: z/OS



Submits an operating system command for execution.
Category: Special
z/OS specifics: all
See: CALL SYSTEM Routine in SAS Language Reference: Dictionary

Syntax
Details
See Also

Syntax

CALL SYSTEM(command);

command

can be a system command enclosed in quotation marks, an expression whose value is a system command, or the name of a character variable whose value is a system command. Under z/OS, "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 expressions 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 expressions 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 z/OS, CALL TSO is an alias for the CALL SYSTEM routine.


See Also

Previous Page | Next Page | Top of Page