Analytic Store Scoring Action Set

Uploading an Analytic Store

This section contains PROC CAS code.

Note: Input data must be accessible in your CAS session, either as a CAS table or as a transient-scope table. A CAS table has a two-level name: the first level is your CAS engine libref, and the second level is the table name. You refer to this table in the CAS procedure by specifying only the second level. For more information about two-level names, see Chapter 2, Shared Concepts (SAS Viya: Machine Learning Procedures). A transient-scope table is called directly from the action and exists in memory for the duration of the action. For more information about accessing data, see SAS Viya: System Programming Guide. For more information about PROC CAS and programming in CASL, see SAS Cloud Analytic Services: CASL Programmer’s Guide and SAS Cloud Analytic Services: CASL Reference.

Although you cannot currently use PROC CAS to upload an analytic store, you can use PROC ASTORE to do this.

The following statements upload an analytic store that is saved in the local file savelocal.sasast to the data table mycas.save:

proc astore;
   upload rstore=mycas.save store="savelocal.sasast";
run;
quit;

Uploading an Analytic Store

This section contains Lua code for the analysis in the CASL version of this example, which contains details about the results.

For more information about coding in Lua, see Getting Started with SAS Viya for Lua and SAS Viya: System Programming Guide.

The following Lua code uploads an analytic store that is saved in the local file savelocal.sasast to the data table mycas.save:

s:loadactionset{actionset='astore'}
inp = assert(io.open("savelocal.sasast", "rb"))
data = inp:read("*all")
store_ = swat.blob(data)
assert(inp:close())
s:astore_upload{
   store = store_,
   rstore = {name="save", replace=true}
}

Uploading an Analytic Store

This section contains Python code for the analysis in the CASL version of this example, which contains details about the results.

For more information about coding in Python, see Getting Started with SAS Viya for Python and SAS Viya: System Programming Guide.

The following Python code uploads an analytic store that is saved in the local file savelocal.sasast to the data table mycas.save:

s.loadactionset('aStore')
with open('savelocal.sasast','rb') as file:
   blob = file.read()
store_ = swat.blob(blob)
s.astore.upload(
   rstore={'name':'save','replace':True},
   store = store_
)

Uploading an Analytic Store

This example is not available for the R programming language.

Last updated: August 04, 2026