BookmarkSubscribeRSS Feed

CAS Actions for SAS® Visual Analytics Report Developers

Started ‎05-15-2018 by
Modified ‎05-15-2018 by
Views 3,528

This article contains supporting information for the 2018 SAS Global Forum paper: Just Enough SAS® Cloud Analytic Services: CAS Actions for SAS® Visual Analytics Report Developers.  This paper focuses on teaching the CAS Actions and in-memory data manipulation techniques needed by developers that are creating reports on the SAS Visual Analytics Platform.

 

Abstract

SAS Visual Analytics includes all of the point-and-click functionality required to load data, manage data, and perform other back-end work necessary to make SAS Visual Analytics visualizations efficient and effective.  But there are a handful of critical tasks that are sometimes just easier to do with a few lines of code, especially if your end goal is to automate that that process.  While there is a substantial and growing codebase for CAS Actions and SAS Viya procedures, SAS Visual Analytics report developers need to focus on the creation and implementation of reports.  What we need is just enough CAS code to simplify the back-end work.  This paper presents some of the most common, most useful CAS actions that can be run from any SAS Viya powered code window, including the SAS Studio interface.  These bare bones code examples include:  loading a data set to a CAS server, using CAS actions to transform data from a “wide” to a “tall” structure, and other formatting operations that make data reporting-ready.  The paper demonstrates, using minimal code, how the scored output of a Viya-based model can be lifted into CAS and made ready for SAS Visual Analytics reporting.  Finally, the paper describes exactly how coded back-end actions affect the SAS Visual Analytics platform, including how to verify that back-end processes are working and ensure SAS Visual Analytics settings for refresh and automated data re-load are set to take advantage of the automated back-end processes implemented in code.

 

just_enough_cas2.png

 

Online materials and examples

SAS Global Forum proceedings

The PDF version of the paper can be found here:

CAS Actions and Code

Several examples CAS actions and how to interact with CAS dataset within SAS Viya are included in the paper. 

These code examples are attached to this post and descriptions of each program is listed below:

  • load_baseball_to_cas.sas
    • Creates a CAS session and assigns all caslibs
    • Formats and loads the sashelp dataset BASEBALL into CAS.
    • Promotes the CAS dataset BASEBALL in order to make it available in SAS Visual Analytics
  • cas_action_examples.sas
    • Runs the cas action 'listacsdata' to determine which groups have direct access to the caslib PUBLIC
    • Run the cas action 'userinfo' to determine which groups the current user is in
  • load_viya_model_output_to_cas_for_VA_reporting.sas
    • Runs a Viya Linear Regression model and captures it's output as a CAS Dataset
    • Promotes the output dataset from the Viya Linear Regression in order to make it available in SAS Visual Analytics
  • create_and_load_sashdat_to_cas.sas
    • Saves the BASEBALL dataset in the caslib PUBLIC as the file BASEBALL_PRD.sashdat
    • Loads the file BASEBALL_PRD.sashdat to the caslib PUBLIC
    • Promotes the CAS dataset BASEBALL_PRD to make it available in SAS Visual Analytics
  • cas_transpose_action.sas
    • Runs the cas 'transpose' to convert a subset of the CAS dataset BASEBALL from a 'wide' to a 'tall' structure.

 

Version history
Last update:
‎05-15-2018 01:26 PM
Updated by:
Contributors

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags