Passing SAS Functions to MySQL

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

Where the MySQL function name differs from the SAS function name, the MySQL name appears in parentheses. For more information, see Passing Functions to the DBMS Using PROC SQL.

By default, the following SAS functions are passed down to the database:

ABS LOWCASE (LCASE)
ARCOS (ACOS) MAX
ARSIN (ASIN) MIN
ATAN MINUTE
ATAN2 MOD (see note)
AVG MONTH
CEIL (CEILING) QTR (QUARTER)
COALESCE SECOND
COS SIGN
COT SIN
COUNT SQRT
DAY (DAYOFMONTH) STRIP (TRIM)
EXP TAN
FLOOR TRANWRD (REPLACE)
HOUR TRIMN (RTRIM)
INDEX (LOCATE) UPCASE (UCASE)
LOG WEEKDAY (DAYOFWEEK)
LOG2 YEAR
LOG10
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.

The following SAS functions are passed down to the database only if SQL_FUNCTIONS=ALL:

BYTE (CHAR) ROUND
COMPRESS (REPLACE) SOUNDEX
DATE (CURDATE) SUBSTR (SUBSTRING)
DATEPART TIME (CURTIME)
DATETIME (NOW) TIMEPART
LENGTH TODAY (CURDATE)
REPEAT
Last updated: February 3, 2026