BookmarkSubscribeRSS Feed
Bluedog
Calcite | Level 5

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.

2 REPLIES 2
TimCampbell
Quartz | Level 8

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.

Bluedog
Calcite | Level 5

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-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
  • 2 replies
  • 938 views
  • 0 likes
  • 2 in conversation