SAS 9.4M9 fails to establish ODBC connections to PostgreSQL and/or MySQL with the following error:
ERROR: CLI error trying to establish connection:
[unixODBC][Driver Manager] Data source name not found and no default driver specified
ERROR: Error in the LIBNAME statement.
This issue occurs after migrating to a new Red Hat Enterprise Linux 10.1 environment. ODBC connections that previously worked are no longer able to connect through SAS.
This issue might affect PostgreSQL and MySQL ODBC connections and can occur when SAS is unable to locate the required ODBC driver, DSN definition, or associated ODBC configuration files.
This issue was determined to be related to ODBC configuration and driver availability outside of SAS rather than the SAS LIBNAME statement itself.
Investigation identified two separate ODBC-related issues:
Testing returned the following error:
[unixODBC][Driver Manager] Can't open lib '/opt/sas/sasbin/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver/psqlodbcw.so' : file not found
This error indicates that the PostgreSQL ODBC driver library referenced by the DSN configuration could not be found at the configured location or was not accessible by the ODBC Driver Manager.
Testing returned the following error:
[unixODBC][MySQL][ODBC 9.6(w) Driver] Unknown character set: 'utf8mb4'
This error indicates a potential compatibility issue between the installed MySQL ODBC driver and the target MySQL or MariaDB database environment.
The ODBC user data source location changed between the original and new environments:
Old Environment:
/home/LFM.LAN/sasoa_produser/.odbc.ini
New Environment:
/root/.odbc.ini
This change could affect how SAS locates DSN definitions and ODBC configuration information.
To work around this issue, complete the following steps:
1. Verify ODBC Driver availability.
For PostgreSQL connections, confirm that the configured ODBC driver exists and is accessible.
Here is an example:
ls -l /opt/sas/sasbin/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver/psqlodbcw.so
If the driver library does not exist or is inaccessible, update the ODBC configuration to reference the correct driver location or re-install the required driver.
2. Verify ODBC configuration files.
Review the following configuration files:
Then, confirm the following:
3. Verify unixODBC configuration.
Collect the following information to verify the ODBC environment:
These commands identify the following:
4. Verify environment variables.
Confirm that SAS uses the expected ODBC configuration:
echo $ODBCINI
echo $ODBCSYSINI
echo $LD_LIBRARY_PATH
Review these values to determine whether SAS and the operating system reference the same ODBC configuration files and driver libraries.
5. Test the DSN outside of SAS.
Validate the DSN directly through unixODBC.
Here are two examples:
and/or
Testing outside of SAS helps determine whether the issue exists at the following:
The following PostgreSQL error typically indicates that the configured ODBC driver library cannot be located:
[unixODBC][Driver Manager] Can't open lib '...psqlodbcw.so' : file not found
The following MySQL error might indicate driver and database character-set compatibility issues:
[unixODBC][MySQL][ODBC 9.6(w) Driver] Unknown character set: 'utf8mb4'
Both errors occur outside of SAS and can help isolate whether the problem originates in the ODBC environment rather than within SAS software.