Chapter Contents

Previous

Next
%SYSCALL

%SYSCALL



Invokes a SAS call routine

Type: Macro statement
Restriction: Allowed in macro definitions or in open code
See also: %SYSFUNC and %QSYSFUNC


Syntax
Details
Example
Using the RANUNI Call Routine with %SYSCALL

Syntax

%SYSCALL call-routine<(call-routine-argument(s))>;

call-routine
is a SAS System or user-written CALL routine created with SAS/TOOLKIT. All SAS call routines are accessible with %SYSCALL except LABEL, VNAME, SYMPUT, and EXECUTE.

call-routine-argument(s)
is one or more macro variable names (with no leading ampersands), separated by commas. You can use a text expression to generate part or all of the CALL routine arguments.


Details

When %SYSCALL invokes a CALL routine, the value of each macro variable argument is retrieved and passed to the CALL routine. Upon completion of the CALL routine, the value for each argument is written back to the respective macro variable. If %SYSCALL encounters an error condition, the execution of the CALL routine terminates without updating the macro variable values, an error message is written to the log, and macro processing continues.

CAUTION:
Do not use leading ampersands on macro variable names. The arguments in the CALL routine invoked by the %SYSCALL macro are resolved before execution. If you use leading ampersands, then the values of the macro variables are passed to the CALL routine rather than the names of the macro variables.  [cautionend]


Example

Example 1: Using the RANUNI Call Routine with %SYSCALL

This example illustrates the %SYSCALL statement. The macro statement %SYSCALL RANUNI(A,B) invokes the SAS CALL routine RANUNI.

Note:   The syntax for RANUNI is RANUNI(seed,x).  [cautionend]

%let a = 123456;
%let b = 0;
%syscall ranuni(a,b);
%put &a, &b;

The %PUT statement writes the following values of the macro variables A and B to the SAS log:

1587033266 0.739019954


Chapter Contents

Previous

Next

Top of Page

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