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".

tags: Enterprise Guide

3 Comments

  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.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <p> <pre lang="" line="" escaped=""> <q cite=""> <strike> <strong>