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


About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Related Posts


  1. Hey Angela & Chris,

    I have a process where every quarter I need to move a program with prompts from a development location to a production location. I have a program that automatically copies all the development programs and saves them in the production location. Basically, copying from one folder and saving the copy in a different folder. However, the program that has prompts associated with it - when it's copied the prompts are lost and I have to manually update it by adding the prompts to it. I'm using EG 6.1 on Base 9.4 M2. Is there a way to programmatically assign the prompts to the program copied to our production location? Second question - is it possible to share prompts with another project? I have two projects where the prompts are the same and it would be great if I could somehow make the prompts available as shared prompts.

    • Chris Hemedinger
      Chris Hemedinger on

      Andrew, busy day, eh?

      EG 7.1 allows you to copy process flows, in whole or in part, and any associated project prompts are copied along with it. Just one of many reasons to consider upgrading ;)

      But no -- you cannot share project prompts in any other way outside of a project. Shared prompts in metadata are supported only for stored processes (and information maps, I think).

      • Hahaha! Yeah been busy the last couple of days testing out some new code. I don't think copying an entire process flow will work for my situation. All the programs are saved outside of EG. If I were to copy the process flow where would the copied programs be saved? I need to save them in a specific production location. To execute them I create a new process flow called production and add the copied programs back to the project. I then add the prompts back to the first program in the process that's executed. The first program also controls the execution of all the subsequent programs. The programs are saved with the production reports and tables they create. The reason is it makes archiving them much easier. I have to save 10 years worth of work (data & programs) for auditing purposes. I save the data and programs in the same production directory so each quarter I can zip up the oldest directory into 1 zip file. We keep 2 years worth unzipped so every quarter we deliver a new version of the programs & updated data and zip up the oldest directory.

        I have used shared prompts in the past for stored processes so was hoping it might be an option somehow in EG. Oh well. Can't wait to upgrade!

  2. 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 on

      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.

Back to Top