When creating a dynamically populated prompt, you might want to dynamically filter the values that are displayed to users. For example, your data might contain 10 international regions, but you want the prompt to display regions only in North and South America. This sample explains how to use a hidden prompt to accomplish this task. Essentially, you make your dynamic prompt dependent on the default values specified for the hidden prompt.
Tip: If you do not need all of the values that are generated for your dynamic prompt, then using this technique can improve performance when your list includes many values.
This sample was written using SAS Information Map Studio 4.2_M2. The sample can be used with version 4.2 and later.
To create the Shoe Sales information map used in the sample, you can submit the PROC INFOMAPS code on the Full Code tab in this sample. The steps in the sample refer to this information map.
Restrict List
as both the Name and the Displayed text for the prompt.Figure 1. Select the values that will be used to subset the visible prompt.
Figure 2. All of your selected values should be specified as defaults.
Tip: The visible prompt does not have to use the same data item as the hidden prompt. You could, for example, use a hidden prompt on Region to subset a list of values from a Subsidiaries data item.
Region Prompt
as the Name and Select a region
as the Displayed text.Figure 3 shows what your Manage Prompts dialog box looks like at this point.
Figure 3. Your hidden prompt (Restrict List) and visible prompt (Region Prompt).
Region Filter
for the Name.Figure 4. The first expression in the combination is your hidden filter.
Figure 5. The complete filter expression.
As shown in Figure 6, only the Region Prompt is displayed, and it contains only those values that you specified as the default values for the Restrict List prompt.
Figure 6. The Restrict List prompt subsets the list of values displayed for the dynamically populated Region Prompt.
For more information about SAS Information Map Studio, see the SAS Information Map Studio documentation page.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Before submitting this code, these tasks must be done:
Note: For information about registering SAS libraries and tables, see Establishing Connectivity to a Library of SAS Data Sets.
%let mpath=/Shared Data/your-map-folder;
proc infomaps metauser="your-userID"
metapass="your-password"
metaserver="your-metadata-server.com"
metaport=8561
metarepository=Foundation
mappath="&mpath";
* delete infomap "Shoe Sales";
open infomap "Shoe Sales";
insert datasource sasserver="SASApp"
table="SASHELP"."Shoes" _all_;
save;
* list _all_;
run;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2011-12-20 10:46:32 |
Date Created: | 2011-12-19 17:00:00 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Information Map Studio | Microsoft Windows Server 2003 Enterprise Edition | 4.2 | 9.2 TS2M0 | ||
Microsoft Windows Server 2003 Datacenter Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft® Windows® for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2008 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows XP Professional | 4.2 | 9.2 TS2M0 | ||||
Windows Vista | 4.2 | 9.2 TS2M0 | ||||
Windows Vista for x64 | 4.2 | 9.2 TS2M0 |