DATA Step, Macro, Functions and more

When stored process using prompts runs on SAS portal can a message be returned to user?

Reply
Frequent Contributor
Posts: 82

When stored process using prompts runs on SAS portal can a message be returned to user?

I have done some research online and can not find any thing specific that explains how to do this, maybe it is not possible for SAS to handle.  Here is the situation:

 

I built a stored process that has 5 prompts available to the user.  The user wants to be able to pick any one or more of the promts.  Since they may or may not populate the prompts,  I did NOT define them as 'required' (in SMC).  I am checking the length on each of the prompts to determine if a value is present and building the 'where clause' using this method.

 

The caviot..... the user wants to make it a requirement that at least ONE of the prompts is populated and it doesn't matter which one.  If the run the stored process and have not entered any values, they would like a message returned that says  "At minimum one prompt value must be entered".  They would click 'ok' on this message box of just close it and be sitting at the same screen and be able to enter a value.

 

Can anyone tell me if this is possible to do in a SAS stored process?  If so, can you explain the method I could use?

 

Thanks!!!

Super User
Posts: 5,082

Re: When stored process using prompts runs on SAS portal can a message be returned to user?

For the steps that are under your direct control, you can use a similar test to what you are using now:

 

%if %length(&prompt1 &prompt2 &prompt3 &prompt4 &prompt5) = 0 %then %do;

Frequent Contributor
Posts: 82

Re: When stored process using prompts runs on SAS portal can a message be returned to user?

Astounding,

Thank you for your reply.... After the "Then Do;"  is the method/code that I don't know how to handle Smiley Sad

PROC Star
Posts: 1,231

Re: When stored process using prompts runs on SAS portal can a message be returned to user?

I don't think it's possible to do this with the default prompting interface.  I haven't used information delivery portal much, but I assume it is very similar to Stored Process Web App. 

 

With SPWA, the work around I have done is to let the stored process run, and then within the code in the stored process, verify that at least one macro variable has been populated with a value, and if that is false, write a simple html file to _webout delivering the error message "please check at least one value" or whatever.   I would think something like that could work from IDP.  With a little javascript, you could probably even pop up an alert box.

 

But that's not quite the same as having the prompt framework catch the input error and prevent the stored process from runnning.

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