05-23-2014 08:57 AM
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?
05-23-2014 10:48 AM
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.
05-27-2014 12:12 PM
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.
05-28-2014 07:37 PM
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:
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:
05-28-2014 01:58 AM
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.
05-28-2014 08:30 AM
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:
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.