BookmarkSubscribeRSS Feed
rho_tullis
Calcite | Level 5
Hello. I successfully set up an ODBC connection on my PC and tested it by connecting to tables using MS Access. The following libname statement references that same odbc connection and completes successfully.

libname srcdata odbc datasrc='DM_training_layer' user='UserID' pw='XXXXX' schema="UserID"
PRESERVE_TAB_NAMES = no PRESERVE_TAB_NAMES = no readbuff=1000 access=readonly;'

However, when I do a proc datasets or try to reference the tables that I know exist, I get the following:

proc datasets library=srcdata;

Directory

Libref SRCDATA
Engine ODBC
Access READONLY
Physical Name DM_training_layer
Schema/Owner Profserv

"WARNING: No matching members in directory."

Has anybody connected to SQL Server with SAS but then not been able to see the tables? Thanks for your help.--Rhonda
2 REPLIES 2
rho_tullis
Calcite | Level 5
I just discovered that my schema name should have contained the owner of the database. I can see tables now that I have the correct value for schema=.
Ksharp
Super User
If you do not know schema, Then use the following code to find it.


[pre]
proc sql;
connect to odbc( dsn= user= password=);

create table schema as
select *
from connection to odbc(ODBC::Sqltables)
;
quit;
[/pre]

Ksharp

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3823 views
  • 0 likes
  • 2 in conversation