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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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