BookmarkSubscribeRSS Feed
klroesner
Quartz | Level 8

Hi folks,
We've just installed anaconda 2 on our SAS Linux server (running RedHat). After the anaconda installation was completed,
we tested the R installation through R commands and works fine:

 

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-conda_cos6-linux-gnu (64-bit)

> print("Hello World")
[1] "Hello World"
> R.home()
[1] "/opt/sas/iml/anaconda2/envs/sas-r-default/lib/R"
>


We added the RLANG command and the R_HOME on sasv9.cfg. We verified the settings:


27 /* rlang set ?*/
28 proc options option=rlang;
29 run;

SAS (r) Proprietary Software Release 9.4 TS1M6

RLANG Enables SAS to execute R language statements.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

30
31 /* R Home set ? */
32 data _null_;
33 R_HOME =sysget("R_HOME");
34 put R_HOME=;
35 run;

R_HOME=/opt/sas/iml/anaconda2/envs/sas-r-default/lib/R
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds


After that, we tried to validate if we could call and execute R through SAS EG using:

proc iml;
submit /R;
print("Hello World!")
endsubmit;
quit;


But the proc iml does not terminate in the SAS Enterprise Guide and I do not see on the server that an R process was started.

Any Idea?

Kind Regards,

Klaus

3 REPLIES 3
Rick_SAS
SAS Super FREQ

A few comments:

1. Your PROC OPTIONS step does not tell us anything. You need to add the VALUE option to make sure the RLANG option is actually set:
proc options option=rlang value; run; 

2. SAS does not officially support the Anaconda distribution of R, but I was able to provide some tips and suggestions for another SAS user who wanted to call Anaconda R from SAS. The previous user was using Windows, but see the thread 

https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-R-and-Anaconda/m-p/379186#M3653

 

 

klroesner
Quartz | Level 8

Thanks Rick for the quick feedback....

 

1) Output from Proc Options:

26 /* rlang set ?*/
27 proc options option=rlang value;
28 run;

SAS (r) Proprietary Software Release 9.4 TS1M6

Option Value Information For SAS Option RLANG
Value: RLANG
Scope: SAS Session
How option value set: Config File
Config file name:
/opt/sas/sas1/config/Lev1/SASApp/WorkspaceServer/sasv9_usermods.cfg

 

2) PATH-Variable 

 We have set the PATH variable in the sasenv_local:

  • export PATH=/opt/sas/iml/anaconda2/envs/sas-r-default/bin:$PATH

 but unfortunately the behaviour is the same. It seems that SAS cannot call R....