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?

 

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1433 views
  • 1 like
  • 2 in conversation