Data in the cloud makes it easily accessible, and can help businesses run more smoothly. SAS Viya runs its calculations on Cloud Analytics Service (CAS). David Shannon of Amadeus Software spoke at SAS Global Forum 2018 and presented his paper, Come On, Baby, Light my SAS Viya: Programming for CAS. (In addition to being an avid SAS user and partner, David must be an avid Doors fan.) This article summarizes David's overview of how to run SAS programs in SAS Viya and how to use CAS sessions and libraries.
If you're using SAS Viya, you're going to need to know the basics of CAS to be able to perform calculations and use SAS Viya to its potential. SAS 9 programs are compatible with SAS Viya, and will run as-is through the CAS engine.
Use a CAS statement to kick off a session, then use CAS libraries (caslibs) to store data and resources. To start the session, simply code " cas; " Each CAS session is given its own unique identifier (UUID) that you can use to reconnect to the session.
There are a few significant codes that can help you to master CAS operations. Consider these examples, based on a CAS session that David labeled "speedyanalytics":
cas _all_ list;
cas speedyanalytics listabout;
cas speedyanalytics disconnect;
cas uuid="&speedyanalytics_uuid";
cas _all_ terminate;
CAS libraries (caslib) are the method to access data that is being stored in memory, as well as the related metadata.
From the library, you can load data into CAS tables in a couple of different ways:
The Proc CASUTIL allows you to save your tables (named "classsi" data in David's examples) for future use through the SAVE statement:
proc casutil; save casdata="classsi" casout="classsi"; run;
And reload like this in a future session, using the LOAD statement:
proc casutil; load casdata="classsi" casout="classsi"; run;
When accessing your CAS libraries, remember that there are multiple levels of scope that can apply. "Session" refers to data from just the current session, whereas "Global" allows you to reach data from all CAS sessions.
Showing how to put CAS into action, David shared this diagram of a typical load/save/share flow:
Existing SAS 9 programs and CAS code can both be run in SAS Viya. The calculations and data memory occurs through CAS, the Cloud Analytics Service. Before beginning, it's important to understand a general overview of CAS, to be able to access CAS libraries and your data. For more about CAS architecture, read this paper from CAS developer Jerry Pendergrass.
To close out his paper, David outlined a small experiment he ran to demonstrate performance advantages that can be seen by using SAS Viya v3.3 over a standard, stand-alone SAS v9.4 environment. The test was basic, but performed reads, writes, and analytics on a 5GB table. The tests revealed about a 50 percent increase in performance between CAS and SAS 9 (see the paper for a detailed table of comparison metrics). SAS Viya is engineered for distributive computing (which works especially well in cloud deployments), so more extensive tests could certainly reveal even further increases in performance in many use cases.
Lexi Hawks is interning for SAS during summer 2018 in the External Communications department. She attends UNC Chapel Hill, where she is pursuing a major in Business Administration and a minor in Journalism.
this is great, thanks so much for sharing, the link to the videos does not appear to be working though
Hi Wendy,
Any joy on getting the video referenced in this article being made available ? Downunder Dave
Hi Dave,
Sorry for the delay in getting the link fixed. The video referenced no longer exists. I was able to find a different CASL tutorial from SGF 2020. I've updated the title and link in the post.
Hi Lexi. I enjoyed reading this information on SAS Viya. I'm still learning a lot about the new SAS Cloud computing environment. Again, I appreciate your info. Thank you!
This site uses Akismet to reduce spam. Learn how your comment data is processed.