BookmarkSubscribeRSS Feed
HenriTheuwissen
Calcite | Level 5

Hi,

I want to use multiple prompts in a flow in SAS/Enterprsie Guide, where the user has to enter for instance a client number and a location. With the info provided by the user, I want to check whether this combination exists in a table. If the combination exists, I want to continue my processing otherwise the user should be prompted to provide other values for the prompt. Can one build this in Enterprise Guide?

Regards,

Henri

7 REPLIES 7
jakarman
Barite | Level 11

Only Eguide (prompting in Eg-project) or using prompts metadata-bases with use of eg Information maps or stored processes.
SAS(R) 9.3 Stored Processes: Developer's Guide


Before I forget to mention the prompts related to dataset input are not very reliable in selecting the correct app-server.
The related libname for that must be unique in your environment not existing in multiple app-servers.
If that does however it will open up a randomly chosen one. not the one you have associated the process to be run on.

---->-- ja karman --<-----
TomKari
Onyx | Level 15

Another option would be to use the tables to give him a pick list for each value, limiting him to only the correct ones.

Tom

HenriTheuwissen
Calcite | Level 5

Hi Jaap and Tom,

The question is more complex than just prompting for parameters.

I am using Enterprise Guide with prompts. Tom, I cannot display a pick list with the values, since I have to look-up in a table with thousands of records. So, the problem is: after the user entered values, some code is executed to verify the entered data (look-up in a SAS table) and when the info is correct, some more steps should be executed; otherwise I need to prompt the user for new, correct values.

Henri

Quentin
Super User

Hi,

I don't know much about EG process flows. 

But I'm a fan of %AnyObs() for checking whether there are any records in a dataset that meet some user-specified criterion passed in via prompt values.

I use a modified version of Jack Hamilton's macro:

http://www2.sas.com/proceedings/sugi26/p095-26.pdf

In web reports, I often collect user prompt values, then check if %AnyObs(MyData) is true.  If it's false, I return a result: "You passed these prompt values, but no records were found.  Please try again"

Roughly based on Don Henderson's approach:

http://hcsbi.blogspot.com/2011/04/this-page-intentionally-left-blank.html

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
jakarman
Barite | Level 11

Henri,
The prompt is a preprocess of the program it is just setting some sas-macro-variables.
When you are needing to do validation by really processing with sas-code the flow is changed. Think in managing the flow.

As you already have a flow to be managed every program could/should start with a check of the point how far it is in the flow and whether this program is allowed to run.
When it is not allowed to run it should set an error (sysrc >1) in SAS. The error recognition of SAS will work on that and not allowing automatic proceeding in the flow.


Back to your question: 
you can do the same with that, let the prompt come, program run and when your checks wrong give a message en set the errorcode (sysrc).
Not very nice for the last wish is missing: starting a program within Eguide as result of some SAS code. The user should interact and restart the program manually.

Eguide is a client listening/serving possible multiple server processes running. At this a see some difficulty in your wish. Suppose many processes would be running simultenously and all were needing a prompt. How should this be designed?

Could be an enhancement request:
-> not only starting sas code manual, make it possible to start programs in a EGP project by a SAS code call.
    

---->-- ja karman --<-----
ChrisHemedinger
Community Manager

Henri,

Here's another potential approach: a custom task that can prompt the user for a value, and pause the project while waiting for an answer:

Process Interruptus: a custom task to pause your process flow - The SAS Dummy

You could combine this task with Conditions in EG (see EG online help about Conditions) to prompt for a value, perform a check, and then follow one branch or another within your project.

Chris

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
HenriTheuwissen
Calcite | Level 5

Hi All,

Thank you all for your input on this topic.

Chris,

you gave me the real answer to my problem.

Regards,

Henri

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2517 views
  • 0 likes
  • 5 in conversation