BookmarkSubscribeRSS Feed

Capturing Intelligent Decisioning 5.4 Generated Code

Started ‎04-15-2020 by
Modified ‎04-15-2020 by
Views 3,609

SAS Intelligent Decisioning is a cool little tool with lots of deployment functionality built in. However, as you field workers know, it usually only takes about 5 minutes before your customer is asking to deploy decision logic in some novel and unsupported way. So how can we get decision and rule set generated code to incorporate in other applications like ESP, remote SAS servers, etc.?


Making the Call

For the purposes of this post, we're only concerned with extracting the generated decision code. So let's look at an example of the actual command used to extract the code:

As you can see, the command is a REST GET. It uses the Viya Decision Management REST API. Breaking the command into pieces, we can see how to use it:


  • Viya server: (Not a real server name)
  • API Command: /decisions/flows/{Decision ID}/code
  • Decision ID: 0b2a6c4f-afa3-4440-9705-16299cbc346c
  • Options:
    • lookupMode: inline
    • isGeneratedRuleFiredColumn: false


For more information on the API and options, see the doc here and here. You can get the Decision ID from the Intelligent Decisioning User Interface (Decision --> Properties Tab) among other places.


The example above extracts the code from a Decision but you can also extract Rule Set code. A sample Rule Set code extraction call is below. Note the different URL path (/businessRules/ruleSets/😞

Below is an example of the API command being rendered through Chrome and producing the decision code.



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




Running the API command in Chrome as shown above will trigger the Viya UI login screen for authentication.


More information on authentication to Viya's REST API can be found here,


Notes and Considerations

  • The code can be rendered a few different ways. Change the codeTarget between MICROANALYTICS and CAS and the lookupMode among format, inline, and package to see which variation suites your needs. The doc is here.
  • For most applications, you want to use lookupMode=inline as that puts all of the decision components in one file.
  • The Decision code will contain lots of extra supporting code components including logging and administrative functions
  • Intelligent Decisioning logic is rendered via SAS DS2 packages. The Decision itself as well as each individual component -- rule set, predictive model, custom code node -- will be defined as a package. The Decision package acts as a driver program calling the other packages. Branch logic is included in the main Decision package.
  • The generated code is intended to run in the codeTarget specified. Using it in any other platform or circumstance will likely require modification.

Search for more content from our group: SAS Global Enablement & Learning.


Version history
Last update:
‎04-15-2020 03:57 PM
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

Article Labels
Article Tags