Passing SAS Functions to Snowflake

SAS/ACCESS Interface to Snowflake passes the following SAS functions to Snowflake for processing. When the Snowflake function name differs from the SAS function name, the Snowflake name appears in parentheses. For more information, see Passing Functions to the DBMS Using PROC SQL.

ABS LOG10 (LOG(10,n))
ARCOS (ACOS) LOG2 (LOG(2,n))
ARSIN (ASIN) LOWCASE (LOWER)
ATAN MINUTE
ATAN2 MOD
CAT (CONCAT) MONTH
CEIL QTR (QUARTER)
COALESCE REPEAT
COS SECOND
COSH SIGN
COT SIN
DAY (DAYOFMONTH) SINH
DTEXTDAY (DAYOFMONTH) SQRT
DTEXTMONTH (MONTH) STD (STDDEV)
DTEXTYEAR (YEAR) STRIP (TRIM)
DTEXTWEEKDAY (DAYOFWEEK)* SUBSTR
EXP TAN
FLOOR TANH
HOUR TRANWRD (REGEXP_REPLACE)
INDEX (CHARINDEX) TRIMN (RTRIM)
LEFT (LTRIM) UPCASE (UPPER)
LENGTH (OCTET_LENGTH(RTRIM()))** *** VAR (VARIANCE)
LENGTHC (LENGTH) WEEKDAY (DAYOFWEEK)*
LOG (LN) YEAR

*At the start of a session, WEEK_START is set to 7.

**Returns the length of a string or binary value in bytes. This is the same as LENGTH for ASCII strings and greater than LENGTH for strings that use Unicode code points. For binary, this is always the same as LENGTH.

***Snowflake does not support passing binary columns to length functions.

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 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 Snowflake. Because of the incompatibility in date and time functions between Snowflake and SAS, Snowflake might not process them correctly. Check your results to determine whether these functions are working as expected.

COMPRESS (TRANSLATE)* TIME (CURRENT_TIME)**
DATE (CURRENT_DATE)** TIMEPART (TO_TIME)
DATEPART (TO_DATE) TODAY (CURRENT_DATE)**
DATETIME (CURRENT_TIMESTAMP)**

*Only COMPRESS with one or two arguments is passed to Snowflake. Because the third argument is not supported for pass-down, SAS always handles it.

**Set TIMEZONE= in the DSN= connection option (for example, TIMEZONE=America/New_York).

Last updated: February 3, 2026