- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi im new in sas and im trying to run an R code in Sas studio:
proc iml;
submit / r;
x<-y+5
endsubmit;
I keep getting this error:
ERROR: SAS could not initialize the R language interface.
ERROR: The R_HOME environment variable was not found.
i already have rlang activated.
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for confirming that the RLANG system option is set. Because the SAS server is running on Linux, the next thing to do is for the admin to define the R_HOME environment variable to point to the path of your R installation directory. This is explained in the doc "Installing R on Linux Operating Systems."
There are additional admin tips in Gilsen (2019), which was presented at the 2019 SAS Global Forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you say more about how you are running SAS?
1. Are you running SAS University Edition?
2. If the answer to #1 is "no," are you connected to a local SAS server on your PC or to a remote SAS server on linux?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rick, thanks for answering:
1-im running Sas 3.8 ( its not university)
2-im connected to a remote SAS server on linux
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
OK, then I think this an issue you need to address with your SAS network administrator. I doubt you have the authority/permission to configure the SAS server. The admin needs to start the SAS server with the -RLANG option. Here is a section of the documentation that you can send to your administrator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Rick, the admin has already started the sas server with the rlang but i still have the error.
maybe its an issue of R version (3.5.2) or where its installed?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please run the following and post the SAS log:
proc options option=rlang value; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for confirming that the RLANG system option is set. Because the SAS server is running on Linux, the next thing to do is for the admin to define the R_HOME environment variable to point to the path of your R installation directory. This is explained in the doc "Installing R on Linux Operating Systems."
There are additional admin tips in Gilsen (2019), which was presented at the 2019 SAS Global Forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Rick! i will contact the admin for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My Admin has carefully performed the two steps mentioned by Rick_SAS, that is.
- Start the SAS server with the -RLANG option; according to:
https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.3&docsetId=imlug&docsetTarget=iml... - Define the R_HOME environment variable to point to the path of your R installation directory; according to:
https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3556-2019.pdf
However, although the "proc options option=rlang value; run;" shows that RLANG is ENABLE; the SAS code with (only) the R script indicated below keeps giving me the following error message.
x<-y+5;
endsubmit;
quit;
Do you guys have any thought on the source(s) of this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The error message says that SAS is trying to load the R code from
/opt/R/3.6.3/lib/libR.so
and that file does not exist.
I am not a linux system administrator, but I think many people install R in /usr/lib/R.
1. Did you successfully install R on Linux from the CRAN source? That is, you are using the official CRAN source, not Anaconda or another third-party version?
2. Can you run R from the R GUI?
I doubt I will be able to help resolve this installation issue. I've never installed R on Linux from CRAN.