BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Can you populate a parameter dropdown list with the values in a variable?

I am trying to build a parameter that takes the values found in one of my variables and uses them as the options in the parameter's dropdown list. However, the 'Variable Name' data type in EG only lists the variable name, not the values in the variable itself.

Any thoughts? Thanks!
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi,
Try this:
Instead of variable name, select "String" for Data Type
and then, for data value type, select "A list of Values"

You should then see (on the left) a "Load Values" button that will let you choose a dataset and choose a variable in the dataset. On the right, you can choose either a single selection or a multiple selection. If I am going to make them pick something from a list, I ALWAYS check/select these choices:
A value is required at runtime
Prompt for value (and your list of variable values will be used)

You can decide about quoting -- I always put my own quotes, unless I'm allowing multiple values separated by a comma (as in a where clause with an IN).

For more help with setting a list of parameter values in EG, for a numeric variable or for a date value, you might consider contacting Tech Support.

cynthia
deleted_user
Not applicable
That's exactly what I was looking for! You have no idea how much time you have saved us.

Now, for one followup question. Do we need to repopulate them into the parameter manually if the values change monthly, and if so, is there a way to refresh the list through code?

Thanks again, Jaime
Cynthia_sas
SAS Super FREQ
Hi:
As far as I know, if the values can change monthly, then you need to repopulate the list to get the new values in the drop down list.
I do not know how to repopulate the EG parameter list with code. You may want to check with Tech Support.

cynthia
ChrisHemedinger
Community Manager
There is not currently a way to populate the parameter list dynamically. You'll need to redo the steps Cynthia described each time you want to update it.

The ability to present dynamic prompts is in the realm of custom tasks, which you can create using .NET. Examples are linked from http://support.sas.com/eguide.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
deleted_user
Not applicable
Thanks for that clarification.

So, what software packages would you recommend in order to start programming custom tasks? I have never had to program in either VisualBasic or .NET.

Thanks!
ChrisHemedinger
Community Manager
If you're targeting EG 4.1, you'll need to use a package that supports .NET 1.1. That usually means Microsoft Visual Studio 2003 (not 2005, which supports only .NET 2.0).

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

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
  • 6 replies
  • 1249 views
  • 0 likes
  • 3 in conversation