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

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
Obsidian | Level 7

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
Obsidian | Level 7

Awesome--working fine after changing to SQLSVR

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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