SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Connect SQL Server to SAS using linked server

Accepted Solution Solved
Reply
Regular Learner
Posts: 1
Accepted Solution

Connect SQL Server to SAS using linked server

Hello.

 

Someone can help me  connect SQL server 2012 to SAS using linked server.

 

I need to read some SAS tables with SQL server. This is possible?


Accepted Solutions
Solution
‎09-16-2016 11:35 AM
Super User
Posts: 5,256

Re: Connect SQL Server to SAS using linked server

If I read the question carefully, I think that all answers so far are backwards.

 

And no, SAS doesn't support database linking using the SQL Server concept. (Does that work with any other database?)

To access SAS data you need a SAS ODBC driver, and the SAS server set up for ODBC connections. Usually this means a license for SAS/SHARE and SAS/SHARE*NET is required. Contact you SAS server administrator/responsible for help.

If you are lucky (?) to have SAS installed locally to your SQL Server, you have the ODBC routine start SAS interactively in the background. But this is definitely not a production like scenario - for personal use only.

Data never sleeps

View solution in original post


All Replies
Contributor
Posts: 61

Re: Connect SQL Server to SAS using linked server

try this

 

%let usr = username;

%let pwd = password;

%let dbname = server;

connect to oracle(user=&usr password="&pwd" path=&dbname);

select * from
connection to oracle(select * from tableA );

 

 

tableA is the dataset that you wanted to read from the db server.

Super User
Posts: 3,102

Re: Connect SQL Server to SAS using linked server

To connect to SQL Server from SAS you need a SAS ACCESS product like SAS/ACCESS to SQL Server or SAS/ACCESS to ODBC both installed and licensed. Run the following to confirm what SAS products you have:

 

proc product_status; run;

proc setinit; run;

 

Super User
Posts: 9,676

Re: Connect SQL Server to SAS using linked server

What do you mean by linked server ?


https://communities.sas.com/t5/SAS-Analytics-U/Connect-to-SQL-Server-Oracle-Database-by-SAS-University-Edition/m-p/273857

Solution
‎09-16-2016 11:35 AM
Super User
Posts: 5,256

Re: Connect SQL Server to SAS using linked server

If I read the question carefully, I think that all answers so far are backwards.

 

And no, SAS doesn't support database linking using the SQL Server concept. (Does that work with any other database?)

To access SAS data you need a SAS ODBC driver, and the SAS server set up for ODBC connections. Usually this means a license for SAS/SHARE and SAS/SHARE*NET is required. Contact you SAS server administrator/responsible for help.

If you are lucky (?) to have SAS installed locally to your SQL Server, you have the ODBC routine start SAS interactively in the background. But this is definitely not a production like scenario - for personal use only.

Data never sleeps
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 1142 views
  • 2 likes
  • 5 in conversation