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 » Stored Processes

Prompt Framework: SAS Shared Prompts are Scrumpdillyicious!

Submitted by on 2012-11-02 – 2:38 PM 8 Comments

When I was growing up, a big treat on a Sunday summer afternoon was to drive into town and get a Dairy Queen ice cream cone dipped in chocolate. Dairy Queen advertised their treats as scrumpdillyicious, which they were to a seven-year old!  If you are not aware, SAS ships some shared prompts that you can use with your stored process … and you guessed it … I think they are scrumpdillyicious!

Locating the Shared Prompts

SAS ships about 15 shared prompts that you can integrate into your stored process.  These prompts are typically found in this location:

SAS Folders > Products > SAS Intelligence Platform > Samples

The shared prompts allow you to select styles, logs, packages, and so on.  Many of the tasks you may routinely need when creating a stored process.  [Contact your SAS Administrator if you cannot find the samples.]

Working With an Example

From the stored process I created in the Using Alternating Background Color with PROC REPORT post, how about we allow the users to select the style?  We will just default to a gray (#F0F0F0) as the alternating color for the row.

Step 1: Adding a Shared Prompt

If you are editing in SAS Enterprise Guide, you can find these sample prompts in the Prompts pane by clicking Sharing > Add Shared and then navigating to the location shown in the following graphic. For this example, I added: ODS Styles – Static and Show SAS Log.

However, notice there are two shared prompts available for styles:

  • ODS Styles – Static         Lists the styles shipped with the system.
  • ODS Styles – Dynamic  Lists the styles available from the system.  If your organization often adds new styles then use this choice as it will give the most updated list.

In most cases, this Lists of Static styles prompt will work and its faster.  The dynamic prompt has to generate the list of styles before supplying the prompt – so only use it if it’s really needed. After adding the ODS Style prompt, I add the Show SAS Log shared prompt to my list – as shown in the following figure.

Step 2: Updating the Code

Now how do we allow the user to select the style?  Probably we need a huge amount of coding changes … so I hope you packed your lunch! I’m kidding – how about if we just delete the Let statement and let the shared prompt do the magic?

In the Before code, I had manually set the _ODSSTYLE value. (i.e. Journal) In the After code, delete the %LET statement.   The ODS Style prompt passes the reserved macro variable to %STPBEGIN, which sets it.  I did add another Title statement just to capture the style name.

No changes are needed for the Show SAS Log prompt.

Reviewing the Results

When I run the results in the SAS Stored Processes Web Application – these are the results.  Notice that the SAS Log appears after the results.

 

In the 50 Keys to Learning SAS Stored Processes book, there are many examples of using prompts including the SAS-supplied prompts. Hope you enjoyed this delicious treat – have you used the SAS shared prompts for any special projects?


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!

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: ,

8 Comments »

  • Good info – thanks Don!

  • I asked TS and R&D several years ago to make the Shared Prompts avaiable in EG and was told it was not an option.

    And I’ve heard since then from a birdie in R&D that the current prompting model is locked in place and won’t see any enhancements. I believe the plans are to build a new prompting framework and the current one leaves a great deal to be desired in terms of how it is architected (which is part of the reason why Shared Prompts are restricted to stored processes).

  • I’m a sucker for the parfaits.

  • Chris S. says:

    I don’t remember what I liked as a kid, but right now a Dilly Bar sounds better than a Banana Split.

  • LOL … wait there’s a shared prompt for that!

    So Chris – did you enjoy any Dilly Bars or were you a Banana Split guy?

  • Chris S. says:

    Oh %window, we’ll miss you so!

    Boy, I was really using a poor man’s SAS.

  • Add that to the SAS Ballot … sounds like a good idea to me.

  • Fred Janssen says:

    Now if SAS would make the shared prompts available via the Prompts Manager in our EG project, that would really be Scrumpdillyicious!