Hello,
I am trying to run some SAS programs directly from R. I have found some possible solutions, but they have not worked for me. Any help would be greatly appreciated. Here are the examples that I have tried.
Method 1: Using a shell to run a SAS program in R.
setwd("C:\\Program Files\\SASHome2\\SASFoundation\\9.4\\")
return.code <- shell("sas.exe -SYSIN C:\\test\\Edit_SAS.sas")
A SAS window opens giving this error regarding the SAS log.
Method 2: Using a SAS engine in R and code chunks:
Below is an example to print out “Hello World”, suggested on another forum:
engine.path = 'C:\\Program Files\\SASHome2\\SASFoundation\\9.4\\sas.exe'
```{sas}
data _null_;
put 'Hello, world!';
run;
(there are 3 ` symbols here)
This does not run. But a warning is visible in RStudio that says that the symbol, `, is an “invalid token”
Thanks for your consideration.
-Fraser