BookmarkSubscribeRSS Feed

Publish and Run a Model In-Database – SAS Scoring Accelerator Introduction

Started ‎10-11-2021 by
Modified ‎10-11-2021 by
Views 3,838

SAS Scoring Accelerator is a product that allows you to export models or decisions built in SAS Viya to a database, so that you can run those models and decisions close to your production data.  


What are the advantages?


It’s all about performance and consistency:


  • There is no data transfer between the database and SAS Viya during the scoring phase
  • You can leverage the database infrastructure (massively parallel environments working on big data) for your scoring jobs
  • The scoring model is published as designed (there is no conversion/translation)
  • Data does not need to exit the database to be scored (which can be important from a data governance standpoint)


SAS Scoring Accelerator Lifecycle


SAS Scoring Accelerator is involved in the last steps of your analytics iteration. Once you have designed your models or decisions (which is a good use of your time), SAS Scoring Accelerator helps you “production-ize” your model/decision. The process, which would require a lot of time and effort with other tools, is very straightforward in SAS Viya: a simple step in the UI or statement in code to publish a model and then run it in the database.



Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.


The user doesn’t have to convert/translate the scoring function into something that the database will understand. The function stays in SAS language and will be executed by a lightweight SAS engine deployed in the database: SAS Embedded Process.  


Which applications leverage SAS Scoring Accelerator?


  You can publish a model in-database in multiple ways depending on the application you use to design your model:

  • From SAS code if you are explicitly using CAS actions or SAS procedures for the modeling phase and you want to finalize the process by publishing it to the database
  • From SAS Model Studio directly if you are designing your models using pipelines
  • From SAS Model Manager if you have numerous models to deal with



Also, if you are using SAS Intelligent Decisioning to build rule sets and decisions (which can also include models) then you will be able to publish them directly in-database as well.


With regard to running a model in-database, SAS Viya only provides programming options such as the SCOREACCEL procedure and the underlying CAS actions (modelPublishing.runModelExternal).


Since you can use CAS actions to publish and run models in-database, you can trigger them from any CAS-compatible language such as Python, R or Lua.  


What is being moved in-database?


This is something you don’t have to worry about since SAS Viya will take care of this transparently and automatically.


But if you are curious, depending on the method/algorithm you use to create your model, the resulting scoring function can be based on:


  • DATA step language
  • DS2 language
  • DS2 language + analytic store (ASTORE)


When it comes to publishing the scoring function, DATA step-based models will be converted to DS2. If they rely on DS2 or ASTORE, they will be published as is. Note that if you publish an ASTORE file only, a DS2 wrapper will be generated.


SAS formats can be involved in the modeling process. For example, you can build a model from a sample table that has formats applied. Or you can create a decision that makes use of a lookup table (which is basically a SAS format). Formats will be moved automatically to the database.




Which data platforms are supported?


As mentioned earlier, SAS Scoring Accelerator relies on the SAS Embedded Process lightweight engine for running scoring functions in-database.


This component must be deployed beforehand in the database. There has been some effort recently to support more and more data providers. This topic is very hot. Indeed, 2021.1.5 brought some new options.


As of 2021.1.5, the following databases/data platforms are supported:


  • Teradata
  • Hadoop
  • Databricks (Spark)
  • Azure Synapse Analytics (Spark)

Thanks for reading.  


Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎10-11-2021 09:35 AM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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