Is there a way to display different selection prompts with values from different tables dependent on what the user selected on a previous prompt? For example, a user selects a
table name from a prompt. I would then want to display the columns for that table in a subsequent prompt, but not all columns from all tables that the user could select from.
Hi Bluedog,
Here is one example that may help....
if you edit and run the following code you should have created 2 tables to give you a list of tables in the sashelp library and the full contents of the library, before continuing you will need to register these somewhere in your metadata.
libname myLib BASE 'path on server';
proc contents data=sashelp._all_ out=myLib.Lib_Contents noprint;
run;
proc sql noprint;
create table myLib.Table_List as
select distinct memname from myLib.Lib_Contents;
quit;
then when you create your stored process, under prompts create the first prompt to be text and 'user selects data from a dynamic list' and use the Table_list table as the data source.
create another prompt in the same way using the Lib_Contents table as the data source and you want the unformatted values to be the NAME column, on this prompt go to the dependencies tab and set it up so that the value of the first prompt is equal to the value of the MEMNAME column.
when you run it it should be set up so that after selecting a table in the first prompt the second prompt only shows columns for that table.
If you have any more questions about this please ask.
Tim.
Thanks! That is very helpful. I also have a better understanding of cascading prompts that I previously didn't think could handle this.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.