SAS/IML Software and Matrix Computations

Statistical programming, matrix languages, and more
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

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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