I am interested in running an R script on SAS Viya.
I'm following the instructions under this github page. https://github.com/sassoftware/R-swat So far, swat is installed as a package on my desktop RStudio.
I'm stuck at the next part, connecting to CAS.
conn <- swat::CAS('cloud.example.com', 8777, protocol='http')
I'm not sure what I should substitute in place of cloud.example.com. How I can enable the connection between R on my computer and SAS Viya for learners? I know I'm missing a small step between loading the swat package and connecting to CAS. I'd appreciate it if you can point me in the right direction.
Thank you!
To specifically answer your question on what the cas server hostname is: you can find it after logging in to SAS Viya for Learners under the "Manage Environment" application's "Server" menu. In JupyterHub though you can pull everything you need from environment variables:
conn <- swat::CAS(Sys.getenv("CASHOST"), port=Sys.getenv("CASPORT"), password=Sys.getenv('SAS_VIYA_TOKEN'))
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!