BookmarkSubscribeRSS Feed
DBailey
Lapis Lazuli | Level 10

I just tried that:

proc sql;
select count(*) as recs
from quest.businessunit;
 
connect using quest as q;
create table work.test as select * from connection to q (
select * from businessunit
);
disconnect from q;
quit;

 

the count worked but the connect using did not.

ODBC_2: Prepared: on connection 1
select COUNT(*) as "recs" from "dbo"."businessunit" TXT_1 WITH (NOLOCK)


ODBC_3: Executed: on connection 1
Prepared statement ODBC_2

ACCESS ENGINE: SQL statement was passed to the DBMS for fetching data.
37
38 connect using quest as q;
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Data source name not found and no default driver specified

I'll see if I can find the authdomain and try a "connect to" instead of "connect as"

Tom
Super User Tom
Super User

In that case open a ticket with SAS support and see if they can explain why it does not work and whether there is a solution.

SASKiwi
PROC Star

@DBailey - My issue is with SQL Server and SAS/Access Interface to ODBC. CONNECT USING works fine with a prior LIBNAME statement, but not with a pre-defined library.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 2067 views
  • 2 likes
  • 4 in conversation