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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

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

4 REPLIES 4
DMoovendhan
Quartz | Level 8

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.

SASKiwi
PROC Star

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;

 

Ksharp
Super User
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

LinusH
Tourmaline | Level 20

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

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