BI Tools

Tips and tricks for building information maps, OLAP cubes, reports, and dashboards

BI Admin

Learn your way around a SAS BI installation.

Visual Analytics

Learn your way around the SAS Visual Analytics tool

Coding & Data

Extract, transform, and load your data into the SAS BI toolset

Stored Processes

Create and design stored processes like a rock star

Home » BI Tools, Stored Processes

Working with Large Prompt Population Lists

Submitted by on 2014-04-21 – 7:38 AM 2 Comments
5a46377r library of congress truck overturn

Source: Library of Congress

In my last post, I warned you about hooking up your huge dataset to a dynamic prompt.  Impending disaster, user unhappiness and worst of all – rework!  Ahhhh the horror of it all!!!

I wish I knew a way to tell you when the dataset was too large for the dynamic prompt, but it is really dependant on your system.  There are a lot of factors that influence stored process speed such as hardware, network, and even if the data lives in a database. Here’s a some alternate strategies for working with larger datasets in your dynamic prompt.  [Quentin provided a tip for working with selection list in this post.]

For these examples I’m using the Consumer Complaints dataset that I downloaded from the Consumer Protection Bureau to use as example data.  I like this dataset because it has its own built-in drama.  What were people complaining about? Kinda like when you see a car accident and you know it might be gross but you can’t stop yourself from looking?  Yeah that.

So far in 2014, there are two credit reporting agencies in the top 3 for the most complaints logged.  Congratulations!

Use a Pre-Built Tiny Dataset

You already know that the dynamic prompt runs code to get the list as shown in the last post.  One way around the larger dataset is to create a smaller pre-filtered dataset for the prompt to use based on the larger dataset. Then use that dataset to populate the prompt, thus eliminating most of the work the prompt needs to do at run time.

In this example, I have a CONSUMER_COMPLAINTS2 dataset with a gazillion company names listed. So I created a second dataset called CONSUMER_COMPLAINTS_TINY that just contained a distinct list of the companies. When you build your prompt, just use the smaller dataset as the data source. Since both datasets contain the same values, it shouldn’t create an issue for the stored process.

smaller dataset in prompt

Use a Dependant Prompt with ABCs

Another problem with a long list is that is takes the user forever to sift through it to find the company they want.  Probably if the company name starts with an A or Z it’s not that bad – but if it’s in the middle of the alphabet it takes forever. You can use a dependant prompt to remedy the situation.

In this example the first prompt contains the letters of the alphabet and the second prompt only pulls the names of the values that start with that letter (see below).  I used a static prompt and a dynamic prompt.

sas dependant prompt

Preparing the data

In the base dataset I added a second column that just contained the first letter of the company name. I also did a special column for those companies that contained a digit.

prompt dataset example

Adding a Static Prompt

Use a static prompt populated with the first alphabet character.  I just typed the letters myself as shown in the example below.  Notice I also added the Number value for those companies whose names start with a digit.

sas static prompts

Click to see a larger image

Adding the Dynamic and Dependant Prompt

I created a second prompt that is dynamic.  It can contain the smaller list shown in the first tip or just be an ordinary dynamic prompt. However the trick is to add the dependant prompt.  Here’s an example of how I did that. [Check this post for more specific steps.]

dependant prompt

 


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!

Never miss a BI Notes post!

Click here for free subscription. Once you subscribe you'll be asked to confirm your subscription through your email account. You email address is kept private and you can unsubscribe anytime.
The following two tabs change content below.

Tricia Aanderud

Director of Data Visualization at Zencos Consulting
Tricia Aanderud is a SAS Business Intelligence and Visual Analytics consultant based in Raleigh, NC who works for Zencos Consulting. She has written several books about SAS, presented papers at many SAS conferences, and has been using SAS since 2001. Contact her for assistance with your next project.

Tags: ,

2 Comments »