Three of the Most Common SAS Stored Process Errors
If you want to learn how to create a stored process at the SAS Global Forum 2013, then make sure you attend the “Building Your First Stored Process” Hands On workshop that Angela and are hosting on Wednesday morning. We will show you how to build a three different stored process with prompts in under 90 minutes. In the meantime, here are the most common errors that new developers make to help you as you get started.
Update: It was a fun presentation – here’s the paper.
Error #1: LIBNAME is Not Assigned
If you develop your stored process code in SAS Enterprise Guide, then the code uses your Connection Profile. Thus it has access to all of your libraries. When that code is moved to the stored process, you might find its generates a “LIBNAME not found error”. A best practice is to always add the LIBNAME statement to your stored process. You can learn more about how the libraries are assigned in the SAS 9.3 user documentation: “Assigning Libraries“. If you are still confused, I thought the SAS 9.2 documentation had a helpful description of pros and cons here.
You don’t have to read the entire background – just find the library connection you need to make as shown below. Note: For this example, system library simply means it does not exist in the metadata so you call the library from the file system.
Error #2: Unexpected or No Results with Macros
If you have added the %STPBegin and %STPEnd macros in your stored process, then you must ensure the Stored Process Wizard does not add it back. If you have added the macros and the wizard has added the macros, then you see where some interesting results might occur. The worse part of troubleshooting the issue is that it can take several hours with the log to determine the issue. Refer to the “Double, Triple Check Those STP Macros ” post for more help.
Error #3: Prompt Always Uses the Same Values
Did your prompt work, but it keeps making the same choice no matter way you select? For instance, you selected the East region but it returns the West region – no matter how many times you select it? You might want to double-check the code to see if you left the LET statements in it. Many programmers test the prompts to ensure they work or create errors to confirm the prompt will fail. If it’s a large stored process, then you may forget you did it. That’s worth some more time trying to find why your prompt failed.
This one has caught me more than once.
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!
Attending SESUG 2015?
If you are planning to attend SESUG 2015 in beautiful Savannah, Georgia on Sept 29 then join me for my talk about data visualization "How to be the MacGyver of Data Visualization"! I'll show you some cool ways to visualize data with SAS Visual Analytics as well as some traps to avoid.
Latest posts by Tricia Aanderud (see all)
- SAS Visual Analytics: Get to the Point with a Geo Coordinate Map - August 30, 2015
- SAS VA: Is Location just a Distracting Character in Your Dataviz? - August 24, 2015
- Do You KISS Your Line Charts? - August 5, 2015
- How Not Knowing Pie Charts Makes You a #DataViz Rookie - May 7, 2015
- 6 Tips for Data Visualization from a Floral Designer - March 26, 2015