There are many things that R just does better. Hence, I am trying to set my system up so I can execute R commands from within SAS using the [submit /R;] and [endsubmit;] commands. However I need some help getting my config files set up properly to do this.
First Steps (to allow SAS to read the R language):
I checked to see if my system was set up to read the R language (code below).
proc options option=rlang;
run;
I got the following in my log:
SAS (r) Proprietary Software Release 9.3 TS1M0
NORLANG Do not support access to R language interfaces
This meant I needed to add the -RLANG option to the config file. I did that. Below is an example of my config file (C:\Program Files\SASHome\SASFoundation\9.3\sasv9.cfg):
-RLANG
-config "C:\Program Files\SASHome\SASFoundation\9.3\nls\en\sasv9.cfg"
(NOTE: the -RLANG had to be above the config reference for this to be recognized properly.)
And the resulting output in my log after re-opening enterprise guide and re-running the proc options code above:
SAS (r) Proprietary Software Release 9.3 TS1M0
RLANG Support access to R language interfaces
Issue (specific to Enterprise Guide?):
I am using SAS 9.3 and R 2.15.2, so according to this (http://blogs.sas.com/content/iml/2013/09/16/what-versions-of-r-are-supported-by-sas/) these versions are compatible.
However, I execute SAS through Enterprise Guide 4.3 (I like organization better). It appears that Enterprise Guide may require some additional stuff in the config file to allow R to run and recognize where it is on my computer.
For example, I try running the following code:
Proc iml;
submit /R;
directory <- "C:\\Data\\Filepath"
FILEpattern1 <- "Fall 12-13.xlsx"
setwd(directory)
filenames1 <- list.files(pattern=FILEpattern1)
endsubmit;
And I get the following error:
15 Proc iml;
NOTE: IML Ready
16 submit /R;
17 directory <- "C:\\Data\\Filepath"
18 FILEpattern1 <- "Fall 12-13.xlsx"
19
20 setwd(directory)
21 filenames1 <- list.files(pattern=FILEpattern1)
22 endsubmit;
ERROR: SAS could not initialize the R language interface.
statement : SUBMIT at line 16 column 1
According to this thread (https://communities.sas.com/thread/34758), individuals using Enterprise Guide also need to define where R_Home is on their computer. The thread discusses changing something in sasenv_local but I need more specific directions.
Any suggestions or advice on how to get this working?