Hello,
In SAS Stored process the prompts pop up first and then the sas code executes based on the filter selection.
Is there a way where I could pre-execute the code in SAS Stored process .
I need to ensure that the promts get the latest updated information which will be provided by the pre code I am referring to.
Thanks
Mushy
You need a dynamic prompt.
Lots of material about dynamic prompts such as
http://support.sas.com/kb/62/051.html
or these about SAS Enterprise Guide prompts (the interface very similar to the Stored Process prompts)
Getting Started with SAS® Prompts
Be Prompt! Do it Now! Creating and Using Prompts in SAS Enterprise Guide
Hi Chris,
Thanks for responding.
In fact my question is , when the dynamic promts use a dataset and we want to update the dataset in the same stored process,
is it possible to first update the dataset in the stored process so that when we open the stored process we get the updated information in the dynamic promt.
Thanks,
Mushy
You would need two stored processes, one that updates the dataset and one that uses it.
Indeed, either a second stored process or a SAS/Connect execution. Anyways, a separate SAS process.
Hello Kurt,
Could you help me on how I could call a stored process from another stored process via EG?
I need ro first create the dataset and need to use that in the promp of another stored process.
Thanks,
Mushy
Hello Kurt,
Could you help me on how I could call a stored process from another stored process via EG?
I need ro first create the dataset and need to use that in the promp of another stored process.
Thanks,
Mushy
You should be able to chain STP's as part of an Enterprise Guide project, IIRC.
But you may be entering the realm of building web applications with STP's here. You have a STP creating a HTML form, from which you then call other STP's (or the same STP to update the form).
Take control of the whole thing with a custom task. If you want power in SAS EG, custom tasks are your best bet. They aren't too hard to do. Focus on a simple Hello World to get started and work up from there.
See these:
https://support.sas.com/documentation/onlinedoc/guide/customtasks/
Not sure this will work, but if the pre-process code could be a single DATA step, then it might be possible to use a DATA step VIEW (https://documentation.sas.com/doc/en/lrcon/9.4/n07vq6hmss6f67n1vhnnn5cw0chh.htm) to calculate the values. And then register that view in metadata and use it as the source for your dynamic prompt. Views are dynamic, the code executes when the view is referenced. I've never tried using a view as a source for a stored process prompt, but it might work. Assuming it's possible to register a view as metadata object.
Hello Mushy,
perhaps this Blog Entry can help you: https://blogs.sas.com/content/sgf/2017/07/28/controlling-stored-process-execution-through-request-in...
It describes how to request a code injection during the STP initialisation.
Regards,
Robert
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.