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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2180 views
  • 2 likes
  • 4 in conversation