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

I am brand new and would like to access the data on my SAS server with the R program.

Is it possible to create such a connection with ODBC?

R Code:

library(odbc)

connection_string <- "DRIVER={SAS IOM Data Server};SERVER="...";PORT="...";TRUSTED_CONNECTION=YES;"  

con <- dbConnect(odbc::odbc(), .connection_string = connection_string)  

data_sources <- odbcListDataSources()

dbDisconnect(con)

 

If yes, how can i setup ODBC on my server, otherwise are there other options here?

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Sajid01
Meteorite | Level 14

Hello
If it is your intention to read SAS datasets (sas7bdat files) then you can read them directly without connecting to a SAS server.
The following link has the details with examples.

https://haven.tidyverse.org/reference/read_sas.html

Kurt_Bremser
Super User

You would need the SAS ODBC driver on the computer where you run R, and SAS/SHARE licensed and set up on the SAS server.

 

If you have SAS/IML licensed, you can use R from within SAS.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 1241 views
  • 1 like
  • 3 in conversation