Stored Process Outputs Data without a Report
You can do more with SAS Stored Processes than just create reports. These little suckers are packed full of power and the only limit is your imagination (and libraries where you have write access!) In this post, you will learn how to use a stored process to move a dataset to another library and not output a report at all.
Creating the Stored Process
The stored process prompts the user for the library location and writes the SASHELP.AIR to the dataset. This example is simple so you can understand the steps of creating a stored process that only outputs data.
Step 1: Register the stored process
Step 2: Add the SAS Code
The code in this stored process uses a prompt to ask the user where they want to store the SASHELP.AIR dataset. The prompt uses the &LIBNAME variable. I’m adding a field to the dataset so when the results are shown – you can see that the change was made.
%STPBEGIN/%STPEND are used to add the ODS HTML code (basically). You can decide if you want to include them or not. Since there is no output they are not needed. My observation is if you uncheck it, the wizard reminds you that it is unchecked every time you go to make a change, so it’s annoying more than anything.
Step 3: Determine where the stored process will run
You can use the stored process or workspace server. Notice that since there are not any results you can leave the SAS Result Types check boxes empty.
Step 4: Create the prompt
Add a LIBNAME prompt to ask the user where they want to place the data. This is prompt is required, so I checked the Requires a non-blank value.
Note: Users must have write permission to the library they choose.
Step 5: Save the Stored Process and Run It
The stored process prompts the user to set the library.
The AIR2 dataset is now available from the Candy library.
What about the SAS STP Web Application?
You can also run this stored process from SAS STP Web Application. In this example I will push the dataset to a different library called EGHelp. When the stored process runs – nothing appears to happen. However, when you look from SAS Enterprise Guide you can see that AIR2 was moved.
Learn More about SAS Stored Processes and Prompts
You can learn more tips and tricks for creating, debugging, and using SAS stored processes in the 50 Keys to Learning SAS Stored Processes book. It's a complete guide to SAS stored processes. Check Amazon for best pricing and quick shipping!
Latest posts by Tricia Aanderud (see all)
- My 7 Favorite Features in SAS Visual Analytics 8.2 on Viya - 2018-01-14
- Creating a Web Analytics Report in SAS Visual Analytics 8.1 - 2017-06-19
- Designing Dashboards: Sending Your Style Vibe - 2017-01-21
- SAS Visual Analytics: Design Versus Reality - 2016-10-05
- Seize the Day! Submit an #SASGF Abstract - 2016-09-21