BookmarkSubscribeRSS Feed
elwayfan446
Barite | Level 11

Hi,

 

I am just now playing with the prompt manager feature in SAS EG.  I am using a proc sql script in a program task and I want the prompt to populate the where clause of the script.  If I only have one variable (field 1 = 'x') it works just fine.  However, I want to write it so I can enter multiple values with the prompt.  (field 1 in ('x','y')).  I get a syntax error when I do this.  I have tried putting the quotes in a single text prompt, multiple text promp, etc. but I can't seem to get it to work correctly.  Can you guys tell me what I am missing?

2 REPLIES 2
FredrikE
Rhodochrosite | Level 12

If I get you right 🙂

 

You can use the EG-macro:

 

proc sql;

select *

from sashelp.class

where %_eg_WhereParam( sex, kalle, IN, TYPE=S, IS_EXPLICIT=0 )

;

quit;

 

Kalle is the name of my prompt, sex is the variable in sashelp.class.

 

You can also resolve the macrovariables your self, but then you need some macro coding.

https://communities.sas.com/t5/General-SAS-Programming/Do-loop-using-a-prompt-generated-macro-variab...

elwayfan446
Barite | Level 11

@FredrikE, thank you for your answer.  The EG macro worked for what I needed so I appreciate that.  I tried to google more information about the syntax of the eg macro but didn't find anything clear.  I am curious to know what TYPE and IS_EXPLICIT it is doing.  Is there more information on this macro anywhere?

 

I looked at the coding for resolving myself.  Looks like some code I will be interested in diving into.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1541 views
  • 1 like
  • 2 in conversation