

This package provides interface to SAS throughsaspy andreticulate.
To usesasr, you need to make sure you have the following
- An SAS server that is accessible from the machine that you want to run
sasr on - The machine that you want to run
sasr has Python and Java
To installsasr, please use the following command
remotes::install_github(repo = 'insightsengineering/sasr')
Reticulate will be installed automatically, but Python packagesaspy will not.
If you do not have Python, you can use the following code to install Python, or it can be installed automatically after you call some python related stuffs.
library(reticulate)install_python()
To installsaspy, use the following code
library(sasr)install_saspy()
After the installation completes, you are ready to usesasr package.
library(sasr)df2sd(mtcars, "mt")result <- run_sas(" proc freq data = mt; run;")cat(result$LOG)cat(result$LST)
Q: Why usesaspy instead of usingssh tunnels?
A: Although we can usessh tunnels to transfer data andexecute SAS commands, there are many restrictions: it onlysupportsssh connection. Usingsaspy, the official Pythoninterface to SAS, we can enable all connection types, withoutreinventing the wheel, e.g. we can also connect to a local SASinstallation with the same syntax, or connect to a remote SASViya throughhttp. In addition, SAS sessions insaspy willnot end until you terminate it (or encounter net work issues),it will be nice to execute multiple SAS code one by one, notnecessarily putting them in one script and execute the wholescript at once. Also, with the update ofsaspy over time,sasr will be easily extensible, to include functionalitiesother than transferring data and executing SAS code.