BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
thewan
Quartz | Level 8

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
You can connect from R using the JupyterHub link in SAS Viya for Learners. You probably would not be able to establish a connection from a local R session on your desktop because of firewall limitations.
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

3 REPLIES 3
gwootton
SAS Super FREQ
You can connect from R using the JupyterHub link in SAS Viya for Learners. You probably would not be able to establish a connection from a local R session on your desktop because of firewall limitations.
--
Greg Wootton | Principal Systems Technical Support Engineer
gwootton
SAS Super FREQ

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'))
--
Greg Wootton | Principal Systems Technical Support Engineer
thewan
Quartz | Level 8
Thank you for the quick response. I have not worked with a JupyterHub link before but I registered for a SAS webinar on connecting to SAS Viya with Python. I am interested in learning how to use this.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 3 replies
  • 671 views
  • 0 likes
  • 2 in conversation