BookmarkSubscribeRSS Feed
a_sasusr
Calcite | Level 5

Hi !

Working on a SAS Intelligent Decision (SID) architecture where we have an external application calling the url endpoint of a master decision flow.

Based on the parameters supplied in the POST, the master decision flow redirect the request to a sub decision flow. Each sub decision flow has specific tasks and the answer (variables and parameters) are transferred back up to master decision flow and back out to the external application. Each sub decision flow has different variables and parameters.

 

What is the best approach of making a neat json array out from SID that only contains variables and parameters from the sub decision flow that returned the answer ?

 

3 REPLIES 3
alexal
SAS Employee

Just mark those desired variables as the output in your decision flow, and you will see them in the results. That's it.

a_sasusr
Calcite | Level 5

Done that.. The problem is that the more sub decision flows you have the more variables will be attached into the json array even though its only 1 flow returning actual values. So the json array gets littered with metadata from variables that have NULL values. So need a more dynamic output of JSON array where only the variables containing values are present

 

 

alexal
SAS Employee
SID will return all variables that you have marked as output, doesn't matter whether they have values or not. From my point of view, you have the following options:
1. Filter empty output variables in your application that works with the results
2. Change the decision flow logic and add DS2 file as the last node, which will check which variables are available and return only those available.
3. Change the decision flow logic without adding DS2 file.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1053 views
  • 0 likes
  • 2 in conversation