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'))
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!