Passing SAS Functions to PostgreSQL

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

ABS LOWCASE (LOWER)
ARCOS (ACOS) MAX
ARSIN (ASIN) MIN
ATAN MINUTE
AVG MOD (see note)
BYTE MONTH
CEIL QTR
COALESCE REPEAT
COMPRESS (TRANSLATE) SECOND
COS SIGN
COT SIN
COUNT SQRT
DAY STD (STDDEV_SAMP)
DAYOFWEEK STRIP (BTRIM)
EXP SUBSTR
FLOOR SUM
HOUR TAN
INDEX (POSITION, STRPOS) TRANSLATE (see note)
LENGTH TRANWRD (REPLACE)
LENGTHC (CHARACTER_LENGTH) TRIMN (RTRIM)
LENGTHN (LENGTH) UPCASE (UPPER)
LOG (LN) VAR (VAR_SAMP)
LOG10 (LOG) YEAR
LOG2 (LOG)
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.
Note: If more than three arguments are provided for the TRANSLATE function, then TRANSLATE is performed by SAS and the function is not passed to the database.

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

ATAN2 ROUND
DATE (current_date) TIME (current_time)
DATEPART (cast) TIMEPART (cast)
DATETIME (now) TODAY (current_date)
MOD
Last updated: February 3, 2026