BookmarkSubscribeRSS Feed

Introducing Parameters and Prompts in SAS Studio Flows

Started 3 weeks ago by
Modified 3 weeks ago by
Views 296

Flow design in SAS Studio on SAS Viya is now more dynamic and reusable.

 

As of SAS Viya stable release 2026.03 you can configure parameters and prompts within flows, allowing users to provide input values at runtime without modifying code.

 

This allows flows to adapt to different inputs while keeping the underlying logic unchanged.

 

 

Understanding Parameters and Prompts

 

In SAS Studio flows, parameters and prompts work together to make flows reusable and flexible.

 

This flow includes two parameters that enable users to dynamically filter results based on Origin and MSRP columns.

 

01_GR_2026-03-24_10-27-08-Copy.png

 

A parameter is a named variable that stores a value used within a flow. Parameters are the same as SAS macro variables, they perform text substitution and can be referenced throughout the flow, including in SAS Program steps or steps that include filters.

 

A prompt is the user interface that allows someone running the flow to provide a value for that parameter at runtime. Prompts enable users to dynamically assign values through an interface such as input fields, date pickers, or drop-down lists.

 

In simple terms:

 

  • Parameter – the variable used in the flow (like a macro variable)
  • Prompt – the way a user provides the value via the interface

 

This allows the same flow to be reused with different inputs without modifying the flow itself.

 

 

Why Use a Prompt?

 

If you’re familiar with prompts in Enterprise Guide, prompts in SAS Studio deliver the same flexibility within a modern, cloud-native flow architecture in SAS Viya. Instead of hardcoding values or updating steps each time a date, region, or threshold changes, you define a parameter once and allow users to provide values dynamically at runtime through prompts.

 

This makes flows more:

 

  • Reusable – Build once and run with different inputs
  • Flexible – Adjust logic without editing code
  • Controlled – Use structured inputs like drop-down lists
  • User-friendly – Provide a clean runtime input experience

 

In short, prompts transform static flows into reusable and adaptable data pipelines.

 

 

Current Capabilities

 

Prompts support several input types that allow users to provide values at runtime. These values can be referenced throughout the flow to dynamically adjust logic without modifying the flow.

 

 

Prompt Types

 

The following prompt types are currently available:

 

  • Text or Numeric field – Accepts free-form text input or numeric values
  • Date and Time picker – Allows users to select a calendar date or a specific time
  • Drop-down list - Provides a predefined set of selectable values (static) or dynamically populates values from a variable (dynamic).

 

Support for additional prompt types will continue to expand in future releases.

 

 

Supported Steps

 

Parameters can currently be used in the following flow steps:

 

  • SAS Program steps
  • Steps that contain a filter (for example, the Query and Branch rows steps)

 

Support for additional steps will expand in future releases, allowing parameters to be used across more parts of a flow.

 

 

Creating and Using Parameters and Prompts

 

This demonstration illustrates how to build a simple SAS Studio flow that uses parameters to control data filtering. The flow uses the CARS sample table and allows the user to dynamically filter results based on selected criteria.

 

A Query step is used to create an output table that filters records based on the selected Origin value. The Generate CSV File snippet is then used to produce a CSV file that contains only records where the MSRP is greater than a user-specified value.

 

Although both sets of filtering could be performed in a single Query step, the query output is designed to support additional processing. In a typical workflow, multiple steps can be connected to the output port of the query node, allowing the filtered dataset to be reused in further analysis or reporting.

 

**Video available or see the expanded steps below**

 

(view in My Videos)

 

 

  1. Create a new flow.

 

Starting with a blank flow, open the Parameters pane by selecting Parameters on the right vertical flow menu.

 

03_GR_2026-03-24_10-13-14-1536x865.png

Blank flow canvas with the Parameters button highlighted on the right vertical pane.

 

 

  1. Create the Origin prompt

 

a. Click Add in the Parameters pane.

 

04_GR_2026-03-24_10-13-23-1024x577.png

Blank flow canvas with the Add button highlighted in the Parameters pane.

 

 

b. In the Add Parameter window, click the Name box and type Origin.

 

c. Leave Prompt at runtime checked.

 

d. Enable the Required checkbox to force the user to enter or select a value when the flow runs.

 

05_GR_2026-03-24_10-13-37-1024x577.png

Add Parameter dialog window with the parameter named Origin.

 

 

e. Select the Properties tab.

 

f. Click the Control type drop-down menu and select Drop-down list.

 

g. Add a label of Choose an Origin: (this is the label users will see when prompted)

 

h. Select Dynamic list.

 

i. Select Browse and choose SASHELP.

 

j. Click the Table name box and enter CARS.

 

k. For the Column name, click Select a column, choose Origin and click OK.

 

l. For the Default item, click Select a value and select Europe and click OK.

 

m. Click OK.

 

06_GR_2026-03-24_10-14-20-1024x577.png

The Properties tab in the Add Parameter window showing the dynamic list is configured from SASHELP.CARS

using the Origin column with a default value of Europe.

 

 

  1. Create the MSRP prompt

 

a. Click Add again in the Parameters pane.

 

07_GR_2026-03-24_10-19-05-1024x577.png

Parameters pane with the parameter named Origin.

 

 

b. Click the Name box and type MSRP.

 

c. Leave Prompt at runtime checked.

 

d. Enable the Required checkbox to force the user to enter or select a value when the flow runs.

 

08_GR_2026-03-24_10-19-35-1024x577.png

Add Parameter dialog window with the parameter named MSRP.

 

 

e. Click the Properties tab.

 

f. Leave Control type as Text or numeric field.

 

g. Add a label of Add an MSRP value:.

 

h. Click the Type drop-down and choose Numeric.

 

i. Select the Default value box and enter 50000.

 

j. Click OK.

 

09_GR_2026-03-24_10-20-07-1024x577.png

Second parameter configured as a numeric input field.

 

 

Now that both parameters have been defined, they can be applied to the steps in the flow.

 

  1. Add the source table to the flow

 

a. Click Library Connections in the navigation pane.

 

b. Expand SASHELP.

 

c. Right-click the CARS table and select Add to flow.

 

10_GR_2026-03-24_10-20-41-1024x577.png

Library Connections is open and the SASHELP.CARS table is available to drag into the flow.

 

 

  1. Add and configure the Query step

 

a. Right-click the CARS Table node and select Add a query to connect a Query node to the CARS table.

 

11_GR_2026-03-24_10-20-55-1024x577.png

Flow canvas showing right-click mouse menu to Add a Query to the CARS table.

 

 

b. Use the Query node details and drag the t1(CARS) table from the Columns pane to the Columns tab within the Select tab to add all columns to the output table.

 

12_GR_2026-03-24_10-21-19-1024x577.png

The Query node details show the populated Columns tab within the Select tab.

 

 

c. Select the Filter tab and expand the t1(CARS) table in the Columns pane.

 

d. Drag the Origin column to the Filter tab canvas.

 

13_GR_2026-03-24_10-21-35-1024x577.png

Adding the Origin column to the Filter tab in the Query node details.

 

 

e. Use the Condition drop-down menu to select Equal to.

 

f. Select Use a quick filter to select a value to add a filter value.

 

14_GR_2026-03-24_10-21-57-1024x577.png

The Use a quick filter to select a value icon highlighted in the Filter tab.

 

 

g. Use the Value drop-down menu to choose Select a parameter.

 

15_GR_2026-03-24_10-22-03-1024x577.png

Select a parameter highlighted in the Add Filter window.

 

 

h. In the Select a Parameter window, select Origin.

 

i. Click OK.

 

16_GR_2026-03-24_10-22-26-1024x577.png

Select a Parameter window enabling selection of the parameters.

 

 

j. Click Filter and notice that a parameter icon appears above the Query node in the canvas, indicating that parameters have been successfully applied to the node.

 

17_GR_2026-03-24_10-23-00-1024x577.png

Filter tab showing Origin parameter assigned to the Filter Value.

 

 

  1. Connect a SAS Program Snippet to the Output port of the Query node.

 

a. Click Snippets in the navigation pane and expand Standard and Data.

 

b. Drag Generate CSV File onto the output port of the Query node to connect it.

 

18_GR_2026-03-24_10-23-33-1024x577.png

Canvas showing Generate CSV File snippet being connected to Query output port.

 

 

  1. Update the output directory path to a location available in your environment.

 

a. In the Code tab of the SAS Program node details, highlight <location on file system to put the CSV file>.

 

b. Click SAS Server in the Navigation pane and expand SAS Server.

 

c. Right-click Files and select Insert as path. If this option is not available in your environment, choose an alternative writable directory.

 

19_GR_2026-03-24_10-24-01-1024x577.png

Insert as path feature for adding path to a code node.

 

 

  1. The filename can also be made dynamic using macro variables.

 

a. After the /, add &Origin.GT&MSRP..csv. The & tells SAS to substitute the parameter values at runtime, and the single period(.) ends the macro variable name and the double period (..) ends the macro variable name while preserving the .csv file extension.

 

20_GR_2026-03-24_10-25-16-1024x577.png

SAS Code showing &Origin.GT&MSRP..csv. used as the file name.

 

 

  1. Continuing to make the flow dynamic, a macro variable can be assigned to the input table name so that the SAS Program references the incoming dataset without hardcoding it.

 

a. In the Node tab of the SAS Program node details, click Ports and variables.

 

b. In the Input Ports and Macro Variables tab, copy _input1, the macro variable that will store the name of the input table for the step.

 

21_GR_2026-03-24_10-25-38-1024x577.png

SAS Program node details showing Ports and variables section in Node tab.

 

 

c. Return to the Code tab in the SAS Program node details and replace the hardcoded table name SASHELP.CARS with the contents of the buffer, _input1.

 

d. Prefix _input1 with an ampersand (&_input1) to indicate that it’s a macro variable, allowing SAS to resolve it dynamically at runtime.

 

22_GR_2026-03-24_10-26-01-1024x577.png

Code tab in the SAS Program node showing macro variable &_input1 used for SAS input table name.

 

 

  1. Apply a filter to the output table in the PROC EXPORT step

 

a. After &_input1 , add (where=(MSRP>&MSRP)) to filter the data so only records with an MSRP greater than the selected parameter value are exported.

 

23_GR_2026-03-24_10-26-19-1024x577.png

Code tab in the SAS Program node details showing WHERE=option.

 

 

  1. Connect the MSRP parameter to the SAS Program node.

 

a. In the Node tab of the SAS Program node details, select the Parameters section.

 

b. Click Add.

 

24_GR_2026-03-24_10-26-35-1024x577.png

Add button highlighted in the Parameter section of the Node tab in the SAS Program node details.

 

 

c. In the parameter list, click MSRP.

 

d. Click OK and notice that a parameter icon appears above the SAS Program node in the canvas, indicating that parameters have been successfully applied to the node.

 

25_GR_2026-03-24_10-26-46-1024x577.png

Select a Parameter window with MSRP selected.

 

 

  1. Run the flow with the default parameter values.

 

a. Click Run on the flow toolbar.

 

b. Confirm the Parameters dialog box appears and has the default values of Origin as Europe and MSRP as 50,000.

 

c. Click OK.

 

26_GR_2026-03-24_10-27-08-1024x577.png

At run time, SAS Studio prompts for both Origin and MSRP.

 

 

d. View the log and confirm the CSV contains only records for the selected Origin and MSRP threshold.

 

27_GR_2026-03-24_10-27-34-1024x577.png

Shows EuropeGR50000.csv with 39 rows.

 

 

  1. Re-run the flow and use the Origin drop-down menu to select Asia.

 

a. Click the Origin drop-down menu and choose Asia.

 

b. Click OK.

 

28_GR_2026-03-24_10-27-45-1024x577.png

The recording also shows the prompt values changed before clicking OK.

 

 

c. View the log and confirm the CSV contains only records for the selected Origin and MSRP threshold.

 

29_GR_2026-03-24_10-27-56-1024x577.png

Shows AsiaGR50000.csv with 7 rows

 

 

This flow demonstrates how dynamic prompts can be used to create flexible and reusable processes in SAS Studio.

 

The flow consists of three main components:

 

  1. CARS Table – The source dataset containing car attributes such as Origin and MSRP.
  2. Query Step – Filters the data using the Origin parameter, a dynamic drop-down list for selecting the manufacturing region.
  3. SAS Program Step – Uses the MSRP parameter, a numeric input, to filter data further within SAS code.

 

By combining these components, the flow highlights how parameters enhance interactivity and reusability, allowing users to run the same flow with different inputs without modifying the code.

 

 

Best Practices for Using Parameters

 

To maintain clear and effective flows:

 

  • Use clear, user-friendly labels
  • Provide sensible default values
  • Apply validation where possible
  • Limit the number of parameters to avoid unnecessary complexity
  • Document the purpose of each parameter

 

 

Final Thoughts

 

Using parameters in SAS Studio transforms static flows into dynamic, reusable flows. Rather than repeatedly modifying code, you can:

 

  1. Define parameters once
  2. Reference them within your logic
  3. Adjust values at runtime

 

This approach improves efficiency, reduces the risk of errors, and supports the development of more robust processes.

 

As SAS Studio continues to evolve, this functionality is expected to expand, with parameters being supported across more steps and additional parameter types becoming available.

 

 

Acknowledgments

Special thanks to the SAS Studio Product Manager, @Alexey_Vodilin ,  and Stacey Syphus for editing, contributions, and valuable suggestions for improving this article. Special thanks also to the whole SAS Studio Product team for developing and delivering this feature.

 

 

If you are interested in learning more about SAS Studio, please visit the SAS Studio Landing page and the SAS Studio Learning Subscription

 

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
3 weeks ago
Updated by:

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags