I am trying connecting to SQL server database.
Have unixODBC driver manager installed + ODBC DataDirector connector installed on linux machine (SAS 9.4).
I can connect using isql command, but not with SAS job,
$isql -v [data srouce name] [user] [pwd] <- can connect using this command.
I have ODBCINI /ODBCINST/LD_LIBRARY_PATH set up correctly under my home dir.
libname test odbc datasrc="datasourcenamefromodbcini" user="user1" pw="password";
ERROR: CLI error trying to establish connection: [iODBC][Driver Manager]Data source name not found and no default driver specified.
Driver could not be loaded
ERROR: Error in the LIBNAME statement.
Am I missing anything? or different libname statement needs to be used? Thank you....
The runtime linker is loading the iODBC driver manager instead of the DataDirect one because the search path for the linker has the iODBC location ahead of the DataDirect one.
For details on how the linker works and how it finds dynamic libraries this Linux man page covers it all.
http://man7.org/linux/man-pages/man8/ld.so.8.html
Putting your DataDirect path first on the LD_LIBRARY_PATH will likely get you a step further in this setup.
export LD_LIBRARY_PATH=/opt/datadirect-install-dir/lib:$LD_LIBRARY_PATH
Ensure LD_LIBRARY_PATH is correctly setup in the sasenv_local file under SAS Foundation directory.
Thanks Selvaraj. Do we need restart after adding it under sasenv_local file?
Did you mean restarting the services? That won't be necessary. A new session would suffice.
I am still receiving same error,
My LD_LIBRARY_PATH looks like this,
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/datadirect-install-dir/lib
I started fresh session and tested. may be libname statement defined different way for odbc datadirect?
The runtime linker is loading the iODBC driver manager instead of the DataDirect one because the search path for the linker has the iODBC location ahead of the DataDirect one.
For details on how the linker works and how it finds dynamic libraries this Linux man page covers it all.
http://man7.org/linux/man-pages/man8/ld.so.8.html
Putting your DataDirect path first on the LD_LIBRARY_PATH will likely get you a step further in this setup.
export LD_LIBRARY_PATH=/opt/datadirect-install-dir/lib:$LD_LIBRARY_PATH
Thanks Simon, worked fine.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.