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

I have a very large file that does not fit into an excel workbook sheet - so I hope to continue processing my STAT analysis with SAS .   My problem is how to convert the *.Rdata file to a *.sas7bdat file .    I suppose I could first save the file from R as a plain text file (*.CSV) , but I'd like to know if there is something else I can try first to export the file from R into SAS.   I have a SAS 9.4 license and am working on windows 64 bit machine. Unfortunately (at this time)   I do not have the IML product licensed.  

RIck did post something related in his his post from 2.5 years ago " Re: Appending data from R to SAS Apr 9, 2012 8:49 PM" ,   but surely other options are available with the latest releases? 


I also want to shout out a THANK YOU to  Matthew Cohen NESUG 2012 paper "SAS® and R Working Together".      Surely the new FREE enticement SAS granted to University students last spring will inspire more R users to give SAS a try.  I thought I would find more questions out there .  Actually - its not ?s  that I am searching for.... just answers!


Note:  I do have SAS/STAT -- so maybe STAT studio can help out?  Again,  I am aware that both SAS Enterprise Miner and SAS/IML handle R formatted data, but I do not have those packages (yet). 

We did recently buy The PC ACCESS Utility - and it is helpful with the many *.xlsx  conversions I do -- but I don't find any mention of R type of PC files specified in the ACCESS documentation.


thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

It sounds like your questions is really "Does SAS provide a utility in Sase SAS for converting a RDATA file to a SAS data set."  I assume you are looking for something like PROC IMPORT.   As far as I know, the answer is "No, Base SAS doesn't provide a utility like that."

There are some third-party macros that convert data to/from SAS and R.  As far as I know, they all use R's write.csv function to write a CSV file and then read that into SAS by using PROC IMPORT or something equivalent. You can read about the various macros in this post:

Twelve advantages to calling R from the SAS/IML language - The DO Loop

You can try Xin Wei's %PROC_R macro if you don't want to run the conversion yourself.

Incidentally, you mention SAS Stat Studio.  That is the old name of SAS/IML Studio. Since you do not have an IML license, that option won't help you.

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

It sounds like your questions is really "Does SAS provide a utility in Sase SAS for converting a RDATA file to a SAS data set."  I assume you are looking for something like PROC IMPORT.   As far as I know, the answer is "No, Base SAS doesn't provide a utility like that."

There are some third-party macros that convert data to/from SAS and R.  As far as I know, they all use R's write.csv function to write a CSV file and then read that into SAS by using PROC IMPORT or something equivalent. You can read about the various macros in this post:

Twelve advantages to calling R from the SAS/IML language - The DO Loop

You can try Xin Wei's %PROC_R macro if you don't want to run the conversion yourself.

Incidentally, you mention SAS Stat Studio.  That is the old name of SAS/IML Studio. Since you do not have an IML license, that option won't help you.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 8925 views
  • 4 likes
  • 2 in conversation