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

Iam trying to connect to sql server from sas and iam able to connect with libname statement successfully but not from the proc sql.

 

what might be the wrong in the below code?

 

LIBNAME genis SQLSVR Datasrc=Genesis_ABC SCHEMA=dbo USER="XXXX" PASSWORD="XXXX";

 

Working Properly 

 

 

proc sql;
connect to odbc as mycon ( Datasrc=Genesis_ABC SCHEMA=dbo USER="XXXX" PASSWORD="XXXX");
create table work.TEST1 as
select * from connection to mycon
(select * from test1_table );
disconnect from mycon;
quit;

 

proc sql getting below error

 

ERROR: The ODBC engine cannot be found.
ERROR: A Connection to the odbc DBMS is not currently supported, or is not installed at your site.

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Try changing your CONNECT TO statement:

 

connect to SQLSVR as mycon ( Datasrc=Genesis_ABC SCHEMA=dbo USER="XXXX" PASSWORD="XXXX");

View solution in original post

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

are there missing quotes

connect to odbc as mycon ( Datasrc='Genesis_ABC' SCHEMA=dbo USER="XXXX" PASSWORD="XXXX");

mmkr
Quartz | Level 8

I tried with single quote and double quote..still getting same error 

SASKiwi
PROC Star

Try changing your CONNECT TO statement:

 

connect to SQLSVR as mycon ( Datasrc=Genesis_ABC SCHEMA=dbo USER="XXXX" PASSWORD="XXXX");
mmkr
Quartz | Level 8

Awesome--working fine after changing to SQLSVR

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1736 views
  • 0 likes
  • 3 in conversation