BookmarkSubscribeRSS Feed
awmk
Calcite | Level 5

Hello all,

So, I know now how to create prompts and use those prompts (which create macro variables) when using standard SAS EG tasks (except filtering - can't seem to use them then?).

Now, I'm looking for some guidance on whether there is a way to write my own program in SAS EG and then put the prompts in there.


My macros were written in Base SAS and it would take me forever to re-do them from scratch in SAS EG. Can I simply cut and paste from Base SAS into a new SAS EG project and somehow integrate the prompts with my macro variables?

So far I've created a new program in SAS and written some basic syntax to create a data set in the work library, then then created some prompts in the prompt manager using the new data set. After that I then tried adding some code to the program to create a new table using only the gender variable. I referenced the macro variable (prompt) i created earlier, however, I get an error message saying it cannot resolve the reference.

I do not have access to stored processes.

Thanks so much for your time,

A

2 REPLIES 2
ChrisHemedinger
Community Manager

A,

You have a couple of options.  For the ultimate control over the user interface, you can create a custom task.  This process involves programming in Microsoft .NET, but the mechanism might be easier than you think.

Custom task reference (with links to information about my book on the topic):

  http://go.sas.com/customtasksapi

Here's an example task that is a front-end for a simple macro:

  Putting the squeeze on your SAS data sets - The SAS Dummy

If you are looking to create a standalone-application (where the user doesn't even see the SAS EG interface), you can use SAS Enterprise Guide automation.  That API and examples are linked from here:

Doing more with SAS Enterprise Guide automation - The SAS Dummy

Finally, if you're looking to use prompts within filters, check out the %_eg_where_param macro.  That's the construct that you need to create effective filters that use SAS Enterprise Guide prompts.  See Angela's guidance on this here:

SAS Enterprise Guide Prompting Examples using %_eg_WhereParam

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
AndyRav
SAS Employee

Hi A,

In our SAS Enterprise Guide classes we teach you how to integrate prompts into queries, tasks, and code.  If you don't get a chance to take our classes, one of our previous instructors Kenny Sucher wrote a great paper that I think will show you exactly what you want to do.  Check out Interactive and Efficient Macro Programming with Prompts in SAS® Enterprise Guide® 4.2.  The section that you will interest you most is on ADDING RUN-TIME PROMPTS TO CODE.  You will discover that the reason your prompts are not resolving is because they need to be added to the properties of the program.  Hopefully between this paper or one of Chris' suggestions, you can get your prompts working.

Andy

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1213 views
  • 0 likes
  • 3 in conversation