BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
woo
Barite | Level 11 woo
Barite | Level 11

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....

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SimonDawson
SAS Employee

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

View solution in original post

6 REPLIES 6
Selvaraj
Fluorite | Level 6

Ensure LD_LIBRARY_PATH is correctly setup in the sasenv_local file under SAS Foundation directory.

woo
Barite | Level 11 woo
Barite | Level 11

Thanks Selvaraj. Do we need restart after adding it under sasenv_local file?

Selvaraj
Fluorite | Level 6

Did you mean restarting the services? That won't be necessary. A new session would suffice.

woo
Barite | Level 11 woo
Barite | Level 11

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?

 

SimonDawson
SAS Employee

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
woo
Barite | Level 11 woo
Barite | Level 11

Thanks Simon, worked fine.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

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.

Discussion stats
  • 6 replies
  • 2534 views
  • 0 likes
  • 3 in conversation