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?
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.
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.
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;
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
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.