BookmarkSubscribeRSS Feed
Quentin
Super User

Hi,

 

Is there a good way that I can use a single dataset to define the response options for several stored process prompts?

 

Suppose I make a MyPrompts dataset like:

Prompt    Value   Label
Prompt1   A         Pretty A
Prompt1   B         Pretty B
Prompt2   X         Pretty X Label
Prompt2   Y         Pretty Y Label
Prompt2 Z Pretty Z Label

 

In SAS Management Console, I would like to define a stored process and create Prompt1 which would have options A/B (formatted as Pretty A / Pretty B)  and also Prompt2 with options X/Y/Z.  Similar to the way you can make a single CNTLIN dataset for PROC FORMAT which defines multiple formats.

 

Currently I end up making a separate dataset for each prompt, and registering each prompt-specific dataset in the metadata, which is a hassle.

 

I think I could do what I want in SAS Management Console when I create a dynamic prompt, if there was a way that I could say to use MyPrompts as the data source for a prompt *and* specify a criteria to subset its rows.  So when I create Prompt1, I would specify the data source as MyPrompts (where(Prompt="Prompt1")).

 

I thought maybe I could get what I want by using Dependencies.  But the dependencies only allow me to subset the source data by the value of another prompt.  In this case, I would want to subset by a literal value.  I suppose it might work if I defined a hidden prompt for each prompt which has the name of the prompt.  But ugh. 

 

Thanks,

--Q.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
1 REPLY 1
Vince_SAS
Rhodochrosite | Level 12

I think that you outlined the two options available to you: (1) separate view or table and (2) hidden, dependent prompt.

 

Vince DelGobbo

SAS R&D

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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