BookmarkSubscribeRSS Feed
Patrick
Opal | Level 21

@Visiting wrote:

It is close to get it work, thank you!

But I got an error: "The RLANG system option must be specified in the SAS configuration file or on the SAS invocation command line to enable the submission of R language statements".

How can I solve this issue?

 


Suggest you read the info under the links provided. For example under the one already shared earlier it clearly states:

Patrick_0-1738799861915.png

 

Visiting
Obsidian | Level 7

Thank you remind me! I noticed that, but I use SAS EG, it is in cloud server, R is not installed there, probably that is why sample code doesn't work.

SASKiwi
PROC Star

In that case the administrator of your SAS cloud platform needs to add the RLANG option. This is not something you can do.

Rick_SAS
SAS Super FREQ

SAS supports importing dataframes. So instead of using write.RData(), just import the dataframe directly:

 

proc iml;

submit / R;
library(datasets)
test<- mtcars
endsubmit;

call ImportDataSetFromR("MySASData", "test");
quit;

proc print data=MySASData; run;
Tom
Super User Tom
Super User

@Rick_SAS wrote:

SAS supports importing dataframes. So instead of using write.RData(), just import the dataframe directly:

 

proc iml;

submit / R;
library(datasets)
test<- mtcars
endsubmit;

call ImportDataSetFromR("MySASData", "test");
quit;

proc print data=MySASData; run;

The requestor said they already have a disk file (Rdata file).  Is that the same thing as a data frame?  Or could it contain some other type of R object?  If what was saved in the Rdata file is not a data frame can you still use that same call routine? Or would they first need to run some R code to convert the object into a dataframe?

Rick_SAS
SAS Super FREQ

RData files can store multiple R objects. But SAS can import only data frames, which are rectangular and are analogous to SAS data sets. This is documented at 
SAS Help Center: IMPORTDATASETFROMR Call
and
SAS Help Center: Transferring Data between SAS and R Software

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 21 replies
  • 4662 views
  • 11 likes
  • 8 in conversation