Special characters (such as % or &) in database passwords need to be escaped on the SAS® Viya® platform


When you define credentials for an authentication domain on the SAS Viya platform, special characters (such as % or &) in database passwords need to be escaped. Alternatively, you can use the PWENCODE procedure on the password and save the encoded text inside SAS® Environment Manager ► My Credentials.

In the following example, DBAUTH is the authentication domain. If your password is &MYPASS, enclose the string in curly braces and use the %STR() function to escape the special character, as shown below:

{%str(&MYPASS)}

In addition, in your code, use the LIBNAME statement to reference the authentication domain as shown below:

libname a odbc dsn=MYDSN authdomain='DBAUTH' ;