Understand why some SAS® Model Studio models require ASTORE-Based Scoring Instead of Standalone DS2 Execution


This SAS KB article will help you understand why DS2 package code generated by SAS Model Studio can run independently for some models while other models require an analytic store and a compatible deployment runtime.

Question: Why can you independently execute DS2 package code generated by SAS Model Studio for some models, while other generated DS2 packages require an analytic store and cannot be used as standalone scoring code with the DS2 procedure on SAS Compute Server?

Answer: The DS2 package code generated for an analytic-store-based model is not intended to be a standalone scoring code for execution with PROC DS2 on SAS Compute Server.

Instead, the generated code is a deployment-oriented scoring artifact designed to run in a compatible execution environment, such as SAS® Micro Analytic Service. When an analytic store is published to SAS Micro Analytic Service, the state of the predictive model is restored and becomes available for scoring new data. An analytic store that is registered with SAS Micro Analytic Service can then be called by a DS2 module.

Therefore, the fact that the generated DS2 package does not execute independently in PROC DS2 does not mean that the code is invalid or nonexecutable. It means that the package was generated for a different DS2 runtime and depends on its associated analytic store.

How Analytic-Store-Based Scoring Works 

For an analytic-store-based model, the DS2 package and the analytic store have separate but complementary functions:

Official SAS documentation explains that analytic store models are delivered as ASTORE files rather than as source code. It also documents how a DS2 module uses the DS2 score package to map variables to the analytic store model’s input and output parameters and identify the analytic store to invoke.

Why the Generated DS2 Package is Useful

Although the predictive model resides in the analytic store, the generated DS2 package provides a human-readable representation of the scoring interface and the orchestration used to invoke the model.

Depending on the generated package, it can help you identify the following:

This information can support model integration, validation, troubleshooting, documentation, and governance. It provides visibility into the deployment interface even though the analytic store itself is delivered as a binary artifact.

The generated DS2 code can also be retained as part of the model artifacts used by an automated deployment workflow. However, the DS2 package itself does not register or deploy the model.

Conditions and Exceptions

DS2 Execution Environments

DS2 is supported in multiple SAS execution environments. However, the capabilities and supported DS2 language features are not necessarily identical across those environments.

For example, SAS Micro Analytic Service supports a subset of the DS2 programming language that is appropriate for high-performance, real-time transaction processing. DS2 batch processing is not supported in that environment.

As a result, a DS2 package intended for one execution environment is not guaranteed to run unchanged in another environment. A package generated for deployment to SAS Micro Analytic Service should not automatically be treated as standalone PROC DS2 batch code for SAS Compute Server.

Standalone DS2 Scoring

A portable, DS2-only implementation is not automatically available for every model type.

When the generated DS2 package invokes an analytic store, the analytic store remains a required model artifact. The DS2 package acts as the scoring wrapper and interface, but it does not replace the predictive model contained in the analytic store.

This behavior is expected and is works as designed.

Custom Scoring Logic

It is technically possible to add logic before or after an analytic-store scoring call. For example, you can edit embedded-processing code to transform input variables before scoring or to flag or modify decisions after scoring.

However, manually editing generated DS2 package code is generally not the preferred approach for maintaining long-term production business logic. Where possible, include the required logic in the SAS Model Studio pipeline or manage it through SAS® Intelligent Decisioning, which helps prevent manually maintained logic from becoming inconsistent when the model or pipeline changes.

Additional Information

The generated DS2 package should be considered together with its target runtime and related model artifacts.

Before attempting to execute generated code independently, determine the following information:

If the package invokes an analytic store, keep the DS2 package and the corresponding analytic store together as related deployment artifacts.

SAS Documentation