Because %SYSFUNC is
a macro function, you do not need to enclose character values in quotation
marks as you do in DATA step functions. For example, the arguments
to the OPEN function are enclosed in quotation marks when the function
is used alone, but do not require quotation marks when used within
%SYSFUNC. These statements show the difference:
-
dsid=open("sasuser.houses","i");
-
dsid=open("&mydata","&mode");
-
%let dsid = %sysfunc(open(sasuser.houses,i));
-
%let dsid=%sysfunc(open(&mydata,&mode));
All arguments in DATA
step functions within %SYSFUNC must be separated by commas. You cannot
use argument lists preceded by the word OF.
Note: The arguments to %SYSFUNC
are evaluated according to the rules of the SAS macro language. This
includes both the function name and the argument list to the function.
In particular, an empty argument position will not generate a NULL
argument, but a zero length argument.
%SYSFUNC does not mask
special characters or mnemonic operators in its result. %QSYSFUNC
masks the following special characters and mnemonic operators in its
result:
& % ' " ( ) + − * / < > = ¬ ^ ~ ; , # blank
AND OR NOT EQ NE LE LT GE GT IN
When a function called
by %SYSFUNC or %QSYSFUNC requires a numeric argument, the macro facility
converts the argument to a numeric value. %SYSFUNC and %QSYSFUNC can
return a floating point number when the function that they execute
supports floating point numbers.
SAS Functions Not Available with %SYSFUNC and %QSYSFUNC
All Variable Information
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: Instead of INPUT and PUT,
which are not available with %SYSFUNC and %QSYSFUNC, use INPUTN, INPUTC,
PUTN, and PUTC.
Note: The Variable Information
functions include functions such as VNAME and VLABEL. For a complete
list, see “Definitions of Functions and CALL Routines”
in
SAS Functions and CALL Routines: Reference.
CAUTION:
Values
returned by SAS functions might be truncated.
Although values returned
by macro functions are not limited to the length imposed by the DATA
step, values returned by SAS functions do have that limitation.