BookmarkSubscribeRSS Feed
Quentin
Super User

I'm trying to create a set of dynamic stored process prompts. 

 

I have all the data needed to use as source data for the prompts in a single SAS dataset, that looks like:

 

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

 

That dataset has all of the values and labels for a group of prompts.

 

What is the best way for me to use this data as a source for the group of dynamic prompts?

 

I know I can split the data into one dataset for each prompt, and then register each of those tables and use them as a data source for each prompt.  But then I end up with N SAS datasets (one for each prompt) and N registered tables.

 

I would love to have just one SAS dataset and one registered table.  Could live with one sas dataset and N registered tables (i.e. each registered table represents a different subset of the SAS dataset).

 

I don't see a way to register a metadata table and only use a subset of SAS dataset rows.  And don't see a way to define a prompt using a metadata table as a source and only use a subset of rows.

 

Perhaps I should be making an InfoMap to use as a source for my prompts instead?  I haven't done that much, but I think there may be more subsetting options?

 

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
3 REPLIES 3
tomrvincent
Rhodochrosite | Level 12
Have each of the prompts as separate fields in one metadata table.
Quentin
Super User

At the time I wrote this (2 years ago : )  I was hopeful that I could get it to work in the normalized vertical structure.

 

I think transposing it to a wide format would be problematic, as each prompt could have a different number of value-label pairs.  I guess if there's an option to ignore null values it could work.  I hate the thought of a wide dataset like that, but I guess I could maintain the data in the vertical structure, and have a job that PROC TRANSPOSES it to be wide.

 

Worth a thought, if I run into this again.  Thx.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
tomrvincent
Rhodochrosite | Level 12
I noticed that nobody provided you with any suggestions which is why I decided to respond. 🙂

Unreplied-to questions are like a sad, cold puppy out in the rain... 🙂

The whole dynamic list is clumsy and limited, but at least it exists at all.

Having 4 fields in the table doesn't seem like that problematic to me. I don't think you could do a transpose out to a metadata table but if you get it to work please share your success story.

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!

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
  • 3 replies
  • 1110 views
  • 1 like
  • 2 in conversation