SAS Decision Builder brings SAS Decision Manager rule flows and predictive models together with conditional logic to build "Decision" services. For example, a Used Car Auction "Decision" might combine a car valuation model with an auto auction rule-flow to create a decision service that looks something like this:
The idea being that a bid decision is governed differently for automatic versus manual transmission cars. For manual cars, the bid decision is generated using a predictive model (DecisionTree) and for automatics, the decision is generated by a rule flow (AutoRuleFlow).
Decision Builder services can be deployed for batch execution but, often, work best as real time services. For example, in the auction setting proposed above, you would need to rapidly generate new bid decisions as bidding escalates. When published for real-time, decisions are deployed to the SAS MicroAnalytic Service as modules. Deployment is performed in the Decision Builder Web Application simply by pushing the "Publish" button.
.
MAS modules are meant to be integrated into web applications and can easily be called via REST (simple HTTP commands). I can approximate this scenario using curl. A curl command calling one of the deployed services would look like this:
This command is performing an HTTP POST method on the http://localhost/SASMicroAnalyticService/rest/modules/b45092bd-edd9-4c70-bea2-5bd725271fe6/steps/execute MAS module step using the local sasdemo user. The posted data comes from a local file, input.json which contains the following JSON. Each variable required for the conditional logic, predictive models, and rule flows must be included.
The response is directed to a file named output.json which, after successful completion, contains the following JSON. The response will contain all the variables returned by the decision service. Most notably here, the field, ISBADBUY = 0 so our bidder is free to bid:
.
In order to see what MAS modules are available along with their input and output message structure, simply query the MAS with the following REST GET query, http://localhost/SASMicroAnalyticService/rest/modules/. It can be issued in any web browser.
When prototyping with test data, JSONLint or another JSON validator can help quickly format the returned JSON so it's easier to read.
This post was designed to convey understanding of Decision Builder services as quickly as possible. To that end it sacrificed best practices and security at the expense of brevity, convenience, and simplicity. However, if working with Decision Builder at a customer site, you should consider the following:
.
Hi Stephen / Anna,
Thanks a lot for this article. I found it useful in validating my steps (for which I am using the HMEQ based tutorial provided in the Decision manager help centre). I also referred the paper
http://support.sas.com/resources/papers/proceedings17/SAS0606-2017.pdf alongside.
However, I did notice a couple of differences between this article and what I see on my installation.
i) I am able to publish my model successfully, however the URL I obtain is <server>/microanalyticScore/modules/evaluate_loans1_0,
not /SASMicroAnalyticsService/rest/modules
Is the below the correct URL to use? (I am on Viya 3.3)
ii) I guess this is a result of (i) , but while I am able to successfully call this through cURL (ie. with above URL), I still get my "output" containing ALL variables - even though I went to Decision manager and just checked BAD/REJECT/REVIEW as output variables I wanted returned. Is there any other way to make the "output.text return only specific variables ?
thanks and regards
Sundar
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.