Why code when %_eg_WhereParam does the work for you?

After unwittingly getting involved recently in a code vs GUI discussion another pro GUI vote came in yesterday when presenting to a customer's internal user group. When creating and using prompts in SAS Enterprise Guide, it is a no-brainer to recommend leveraging the %_eg_WhereParam as it handles all the special coding requirements to process prompts. Here are three very quick movies to show how it is done.

Single Selection Prompt in SAS Enterprise Guide

Use SAS Enterprise Guide to generate a single selection prompt off of a static list of values.

Multiple Selection Prompt in SAS Enterprise Guide

Use SAS Enterprise Guide to generate a multiple selection prompt off of a static list of values.

Date Range Prompt in SAS Enterprise Guide

Generate a date range prompt for only 2011 data and apply to the data table.

Need more ideas/information?

For more information on using SAS Enterprise Guide Prompt Manager, refer to my SAS Global Forum 2011 paper "Creating Reusable Programs Using SAS Enterprise Guide Prompt Manager".


  1. Posted March 18, 2012 at 7:39 am | Permalink

    These are very helpful tips for the basic prompts. If you are interested in some of the lesser used promtps - such as variable prompt - check out Stored Processes and Prompts!

  2. Thaphei Chang
    Posted September 10, 2013 at 11:36 pm | Permalink

    I am in the process of converting SAS EG 4 programs to SAS EG 5.1.
    I have just found out that the following statement that worked in SAS EG 4:
    where variable in ("&parameter")
    does not work in SAS EG 5.1 unless I use the following:
    %_eg_WhereParam( vairable, parameter, IN, TYPE=S, IS_EXPLICIT=0 )

    Any reason why the the previous statement does not work. Seems like a lot of coding for a simple selection process.

    • Chris Hemedinger Chris Hemedinger
      Posted September 16, 2013 at 8:56 am | Permalink

      Thaphei, the entire SAS prompt model was revised in SAS 9.2 (effective with EG 4.2 and later). This makes the prompts work consistently across all SAS products: EG, SAS Add-In for Microsoft Office, Web Report Studio, and more. The new prompt model supports more prompt types as well as relationships such as dependent prompts.

      A side effect of this change is that the coding process for using these prompts is more complex...hence the %_eg_WhereParam() macro.

  • About this blog

    Angela Hall manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela is co-author of the book Building Business Intelligence using SAS: Content Development Examples and The 50 Keys to Learning SAS Stored Processes
    BI Bible Book 50 Keys to STP Book
  • Subscribe to this blog

    Enter your email address:

    Other subscription options

  • Archives