Passing SAS Functions to Microsoft SQL Server

SAS/ACCESS Interface to Microsoft SQL Server passes the following SAS functions to the data source for processing if the DBMS server supports this function. Where the Microsoft SQL Server function name differs from the SAS function name, the Microsoft SQL Server name appears in parentheses. For details, see Passing Functions to the DBMS Using PROC SQL.

ABS LOWCASE
ARCOS MAX
ARSIN MIN
ATAN MINUTE
ATAN2 MOD (see note)
AVG MONTH
BYTE (CHAR) QTR (QUARTER)
CEIL REPEAT
COALESCE SECOND
COS SIGN
COSH SIN
COT SINH
COUNT SOUNDEX
DAY (DAYOFMONTH) SQRT
DTEXTDAY (DAYOFMONTH) STD (STDEV)
DTEXTMONTH (MONTH) STRIP (RTRIM with LTRIM)
DTEXTWEEKDAY (DAYOFWEEK) SUBSTR (SUBSTRING)
DTEXTYEAR (YEAR) SUM
EXP TAN
FLOOR TANH
HOUR TRANWRD (REPLACE)
INDEX (LOCATE) TRIMN (RTRIM)
LEFT (LTRIM) UPCASE
LENGTH VAR
LOG WEEKDAY (DAYOFWEEK)
LOG10 YEAR
Note: SAS does not modify non-integer arguments to the MOD function. If your DBMS does truncate non-integer arguments to MOD, then DBMS results for this function might vary from SAS results. For more information, see Functions Where Results Might Vary: MOD Function.

SQL_FUNCTIONS=ALL can process SAS functions that have slightly different behavior from corresponding database functions that are passed down to the database. However, only when SQL_FUNCTIONS=ALL can the SAS/ACCESS engine also pass these SAS SQL functions to Microsoft SQL Server. Because of incompatibility in date and time functions between Microsoft SQL Server and SAS, Microsoft SQL Server might not process them correctly. Check your results to determine whether these functions are working as expected.

COMPRESS (REPLACE) TIME (CURTIME)
DATE (CURDATE) TODAY (CURDATE)
DATETIME (NOW)
Last updated: February 3, 2026