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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3791 views
  • 0 likes
  • 2 in conversation