Desktop productivity for business analysts and programmers

Use Prompts to conditionally execute Process Flows

Reply
Occasional Contributor
Posts: 14

Use Prompts to conditionally execute Process Flows

Hi,

How can I use a prompt to run a Process Flow? For instance, if the result of a prompt is value ABC, then run Process Flow 1, if the result is value QPR then run Process Flow 2.

Henri
Contributor
Posts: 38

Re: Use Prompts to conditionally execute Process Flows

One way is to use the macro values in %if %then %do blocks or to use %include statements or to use dynamic code built depending on the macro values. This is the basics for dynamic SAS programming!!! It's very flexible and a feature that makes SAS stand out as a premier 4 GL tool.
Community Manager
Posts: 2,884

Re: Use Prompts to conditionally execute Process Flows

Have you seen Conditions in EG 4.2 and 4.3?

You can attach a Condition to any node that can be run (task, query, program) and if the condition is met, the node (and all downstream nodes in the flow) will run. If not, the flow stops right there.

You can use a prompt value as a condition (as well as date/time, data value, and in 4.3 we added macro variable value).

Right-click on the first node in your flow and select Condition->Add to see how it works. If you want to pre-empt the entire flow, add a dummy SAS program node (doesn't need anything it) at the start of the flow, and link all subsequent nodes to it (right-click->Link to...). Then add the Condition to that first node. If the condition fails, the entire flow is skipped.

Chris
SAS Employee
Posts: 1

Re: Use Prompts to conditionally execute Process Flows

Chris, I have a question... to use the condition is very helpful, but when I run the whole flow, all prompts must be filled, even though the condition is based on a previous prompt and it fails. What can I do if I want the prompts to appear conditionally, based on the values on the previous prompts? I don't want all the prompts to appear when I run the flow/project.

I really appreciate your help!

Ask a Question
Discussion stats
  • 3 replies
  • 1023 views
  • 0 likes
  • 4 in conversation