PROC STP is a new procedure for SAS 9.3 Stored Processes. It's so new and different that I have not had the opportunity to use it yet in a customer engagement. When writing about it for the now released "The 50 Keys to Learning SAS Stored Processes" book, I had to dream up several good examples.
But to dream up possible uses, understanding what this new fangled thing can and cannot do was of the utmost importance. Single and multiple parameters can be passed into the procedure using the INPUTPARAM statement. Data from the stored process could be returned into the current session using the OUTPUTDATA statement. Add the REPLAY option to immediately see the ODS output in your client session, or store it and use PROC DOCUMENT to push the content to a permanent location. Here is an example of this trick in action.
Most importantly, the STP Procedure retrieves the .sas code and runs in the client session. So for BASE SAS users, if the .sas code is not in a shared (and identically mapped) location in the client and the server systems, the client session will not be able to locate the code to run. Wait, remember the discussion about 9.3 allowing sas code to be stored in the metadata directly? I venture that this eliminates the constraints of storing the .sas files in shared & identically mapped locations. Otherwise, SAS Enterprise Guide could act as the interface by running the PROC STP on the server directly.
After knowing all of this, here are a couple of my ideas.
- Grabbing the resulting data from a stored process for further analysis in my local session
- Retrieving the ODS output from one or more stored processes (during a monthly batch process) to include everything together into a single Monthly Report
- Using the procedure within another stored process, similar to chaining, to reduce/reuse/recycle existing code.
What other uses do you see for PROC STP? What are you looking forward to trying?
For more examples on using PROC STP, check out the last chapter of my new book, co-authored with Tricia Aanderud, "The 50 Keys to Learning SAS Stored Processes". Buy it today or register by 10PM, Monday April 16th to win a free copy!