Sas InformationMap Document
Sas InformationMap Document
Paper 212-2007
SAS Information Map Studio and SAS Web Report Studio A Tutorial
Angela Hall, Zencos Consulting LLC, Durham, NC
Brian Miles, Zencos Consulting LLC, Durham, NC
ABSTRACT
Find out how to provide the vital link between critical data and Business reporting. Learn to develop, deploy and
administer analytic reports from Web Report Studio. From creating information maps off of cubes, tables, and
relational tables to applying row level security on reports, this tutorial will demonstrate how to deploy customized BI
reports in an efficient and effective manner.
INTRODUCTION
The purpose of this paper is to provide examples of functionality from within SAS Information Map Studio and SAS
Web Report Studio in a manner that is easy to follow and replicate. The examples are based off of the
SASHELP.SHOES data set that is distributed with SAS 9.
SAS Information Map Studio enables its users to apply the business logic and business terms to data whose fields,
calculations, and naming conventions tend to be more IT centric. This tool can serve as the single place that business
rules are applied and made available to business users throughout the enterprise.
SAS Web Report Studio is a web based ad hoc reporting application that utilizes the business logic contained within
Information Maps that are created in SAS Information Map Studio. Reports developed in SAS Web Report Studio
are easily customizable and can utilize report level or data level (row based) security.
Step 1: Assign SASHELP Libname to the location of the SASHELP.SHOES table. Import metadata for the
SASHELP.Shoes table into SAS Metadata from the SAS Management Console.
Here is how the libname is assigned on our server:
LIBNAME SASHELP BASE "C:\Program Files\SAS\SAS 9.1\core\sashelp" ;
Step2: Assign Maps libname to the location of SAS Map tables on the server. Import metadata for the NAMES and
WORLD tables. The Maps libname needs to be preassigned to the SAS spawners as well. This can be
accomplished in the Management Console.
1
SAS Global Forum 2007 Tutorials
Step3: Create a Stored Process that has an output of NONE and is executed by the Object Spawner (Information
Maps can only execute Stored Processes associated to the Object Spawner). We named the stored process Set
Geo Formats.The following syntax is used for the stored process:
%STPBEGIN;
options fmtsearch=(sashelp.mapfmts) ;
data maps.names;
set names;
run;
2
SAS Global Forum 2007 Tutorials
%STPEND;
Select the data table(s) that contains the data for the information map. We select the SASHELP.SHOES and
MAPS.NAMES tables.
3
SAS Global Forum 2007 Tutorials
Data can be categorized by folders laid out in a custom directory structure. Folders are very useful when Information
Maps contain many attributes.
4
SAS Global Forum 2007 Tutorials
All attributes within SAS Information Map Studio are defined as measures or categories. A measure is any data
attribute that can be aggregated or quantified (like revenue, # of widgets, customerID, etc). Category attributes are
used to classify aggregations (like year, region, etc.).By default, numeric fields are as classified metrics and non
numeric fields are classified as category variables. In some cases, numeric attributes dont make sense aggregated.
To change the properties of an attribute, right mouse click on the attribute and select properties.
Click on the Classifications / Formats tab. Select whether or not the data attribute is a measure or classification.
SAS formats can be selected for data attributes from within the same window. In many cases, custom formats are
required to turn codes and keys into meaningful category variables. For user defined formats to be accessible to
SAS Information Map Studio, either a LIBRARY libname must be set to the location of the formats or the
FMTSEARCH option must be used in the SASv9.cfg file. Details on custom formats are located at the following link:
http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/infomap_tips_9310.pdf
5
SAS Global Forum 2007 Tutorials
STORED PROCESSES
SAS Stored Processes can be executed prior to resolving data in an information map. This is critical for situations
where an Information Map needs to be used, but data needs to be updated first, SAS code needs to be run to
access data, or set SAS macro variables need to be set.
Select a stored process. Only Stored Processes that use the SAS Object Spawner as the execution server are
available from the selection screen.
FILTERS
Filters are predefined subsetting logic that can be applied to Information Maps. Filters can be based off of category
attribute values (like Region=Africa) or by comparing the aggregated amount for a measure (like Revenue >= 100).
Enter a name. Select the information map attribute to filter by (In this case Region is selected). Then select how the
filter will be applied:
6
SAS Global Forum 2007 Tutorials
Select the tables to build the relationship between. Specify whether or not to perform an outer join and the type of
cardinality between tables. Select the columns to join and click the add button.
7
SAS Global Forum 2007 Tutorials
Notice the fields I selected are different types (Region is char and Cont is numeric). We need to click Advanced Edit
and change the join logic.
Change the logic to use a put statement on the Conf field to get the region text in the contfmt format. Click OK.
PROMPTS
Prompts allow SAS Web Report Studio users to specify one or more values when a query is executed. The values
that SAS Web Report Studio users insert are used to apply a filter to the reporting data set and when the query
completes, the report contains values from the customized subset of data.
8
SAS Global Forum 2007 Tutorials
Put in a name, description, and the text that SAS Web Report Studio users will be prompted with. Click on the
Prompt Value Generation tab.
Select the data attribute that will be filtered and put a default value in, if there should be one.
Click OK when done.
In order for a prompt to work, it must be associated to a filter. Click on the filter icon.
9
SAS Global Forum 2007 Tutorials
Create a new filter for the variable that youre prompting values for. Select the option Prompt user for value(s) and
then select the prompt that will be used to populate the filter.
CUSTOM CALCULATIONS
Custom calculated fields can be created off of any data attributes (Category or Measure) that exist in the information
map.
Select the New Data Item icon.
Assign a name to the new data item. Select the folder that it needs to be added to within the information map
directory structure, in this case we selected Measures. Click the edit button to insert a formula.
10
SAS Global Forum 2007 Tutorials
Place any type of syntax that is valid for columns generated in proc SQL code. In this example we use a case
statement to keep from dividing by 0. To validate the syntax for a new expression, click on the Validate Expression
window.
SECURITY
Security can be set on an Information Map as a whole or by assigning a pre-filter which applies row level security to
users or groups.
A pre-filter or mandatory filter can be applied before any other filters are applied. Pre-filters can be either applied
based off of users or groups or a general filter can be applied to the information map, regardless of the user or group.
Information Maps must be saved before a pre-filter can be applied, otherwise the Authorization option will not be
available.
Select ToolsAuthorization.
For users or groups that shouldnt be able to access the information map, deny read and read metadata access for
those users. For the user or group that needs a pre-filter applied, click on the grey box around the read permission
box until the Add Condition button is available.
11
SAS Global Forum 2007 Tutorials
Click on the Add Condition button. Select the filter that needs to be applied for security and click ok.
TESTING
It is always a good idea to test information maps out in SAS Information Map Studio before using them from any of
the reporting tools. If data from an information map cannot be surfaced from within SAS Information Map Studio,
then it wont be able to be surfaced from other reporting tools.
Move the fields for the test over to selected items. Click view. To see the Proc SQL or MDX syntax for the query, click
on the View Query button. To execute the query, select the Run Test button.
12
SAS Global Forum 2007 Tutorials
13
SAS Global Forum 2007 Tutorials
When the Select Data pop up window appears, click on the Change Source link at the upper right corner to
change the information map used in the report.
Use the arrows to move items over to the Selected data items: box. To create custom calculations that are available
in the report, click on the Custom tab.
Insert a name for the custom calculation and insert an expression. Click the Add button to add the new custom
calculation to the report. Then click OK.
14
SAS Global Forum 2007 Tutorials
When the Edit Report screen refreshes, the data items selected in the Select Data window should be displayed in
the list of data items.
To select an existing filter created in the information map, just click the drop box next to a category data item in the
Data item: select box.
Give the filter a name, an operator, and select whether to put in a value or prompt users for values.
15
SAS Global Forum 2007 Tutorials
By default, the new filter is selected in the Data item: box. All data that is surfaced in the report (with the exception of
stored processes) will filter the data by filters selected in the Data item: box.
LAYOUT CUSTOMIZATION
The report section is the area where the report output can be customized. The layout for a report is generally a grid.
Users can use the toolbars in the upper left corner of the grid to add new rows/columns, split rows/columns, or
combine rows/columns.
The layout that I am using consists of 3 rows and 3 columns. In the first column, all three rows are merged into 1 cell.
In the second column, the last two rows are merged into 1 cell.
A header for the report can be created by clicking on the header link.
16
SAS Global Forum 2007 Tutorials
Two types of tables can be inserted into reports. A list table requires all column headers to be placed on the columns.
The crosstab table object enables data items to be placed on the row and/or column axis and categories are cross
tabulated.
Once an object is placed into the report, each object has a toolbar above it. The toolbars allow users to order and
place data items on the appropriate axiss, apply filters at the object level, sort, apply totals, etc.
Below are examples of how to order data attributes for the list and crosstab tables.
17
SAS Global Forum 2007 Tutorials
To insert text, drag and drop the text icon onto the layout grid.
Alignment tools exist on the bottom left hand corner of the report section. Select the object that needs to be center,
left, or right aligned. Click on the appropriate button to align it.
Scroll to the top of the screen. Click the View Report button.
18
SAS Global Forum 2007 Tutorials
Select a stored process that SAS Web Report Studio can access and click ok.
Since the stored process requires form input, the page prompts me to select a product for the stored process. Click
the View Report button after selecting a stored process.
Below is the report with the output of the stored process in it.
19
SAS Global Forum 2007 Tutorials
SAVING REPORTS
Report can be either saved in a shared location or in a metadata directory that is only available to the report
generator.
ReportSave As
CONCLUSION
In conclusion, the combined usage of SAS Information Map Studio and SAS Web Report Studio enables data and
business rules to be surfaced to end users in a flexible, ad-hoc reporting environment.
CONTACT INFORMATION
Your comments and questions are valued and encouraged. Contact the author at:
20
SAS Global Forum 2007 Tutorials
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. indicates USA registration.
Other brand and product names are trademarks of their respective companies.
21