0
votes

I use a SAS Enterprise Guide (7.12) that accesses to a data on a server, and a local installation of "R Open". I am trying to run R codes using SAS/IML Studio as I have the impression that this can handle the local installation of R (which proc iml inside SAS EG cannot). I have checked that RLANG is enabled, i.e. by entering

proc options option=RLANG;

run;

I get :

RLANG             Enables SAS to execute R language statements.

with no error. Unfortunately there is no R installed on the same server as SAS EG runs, so by submitting an R code I get the following error message :

»ERROR: SAS could not initialize the R language interface.
»ERROR: An installed version of R could not be found.

Edit : To answer one of the comments, I already have set R_HOME variable to my local R Open folder as follows

options set=R_HOME='C:\PROGRA~1\MICROS~4\ROPEN~1\R-34~1.2';

and I have tried the following as well:

options set=R_HOME='C:\Program Files\Microsoft\R Open\R-3.4.2';

and still no success.

Given this, is it possible at all to run R codes from SAS/IML Studio?

1
It can't find R, you have to tell it where it is with the R_HOME variable, e.g. options set=R_HOME='C:\Program Files\R\R-3.1.2';IceCreamToucan
I edited the postDr. Kandy Junior
Is your EG profile connecting to a remote SAS Server or local machine ? For the case of an EG profile connecting to a SAS Server, the R installation has to be on the server as well. The R_HOME on the server would be the a path relative to your login home (local R installation under the IT radar), or absolute to the machine (IT blessed R installation).Richard
EG connects to a SAS server. On that server there is no R installed. So you mean there is no hope if this is the case?Dr. Kandy Junior

1 Answers

0
votes

The documentation for calling R from SAS/IML Studio on the client (local PC) is available in the SAS/IML Studio Help System: Help -> Help Topics -> Accessing R

When you want to use client-side R, the value of RLANG is not used (and anyway your call to PROC OPTIONS is giving the value on the server, not the client). Similarly, the OPTIONS statement sets the RLANG value on the server.

To set the value of R_HOME on the client, first make sure SAS/IML Studio is closed. Then use Windows tools to set the value of the R_HOME environment variable. You can do this from the Control Panel or by typing 'environment variables' when the Start menu is activated. The button to set environment variables is on the "Advanced" tab of the "System Properties" dialog box.

The next time you launch SAS/IML Studio, it will read the R_HOME environment variable and be able to find R from an IMLPlus program.