sas 9.1.3 olap serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...defining member...

156
SAS ® 9.1.3 OLAP Server User’s Guide Second Edition SAS ® Publishing

Upload: hoangcong

Post on 30-Aug-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS® 9.1.3 OLAP ServerUser’s GuideSecond Edition

SAS® Publishing

Page 2: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2006.SAS ® 9.1.3 OLAP Server: User’s Guide, Second Edition. Cary, NC: SAS Institute Inc.

SAS® 9.1.3 OLAP Server: User’s Guide, Second EditionCopyright © 2006, SAS Institute Inc., Cary, NC, USAISBN 13: 978-1-59047-821-9ISBN 10: 1-59047-821-5All rights reserved. Produced in the United States of America.For a hard-copy book: No part of this publication may be reproduced, stored in aretrieval system, or transmitted, in any form or by any means, electronic, mechanical,photocopying, or otherwise, without the prior written permission of the publisher, SASInstitute Inc.For a Web download or e-book: Your use of this publication shall be governed by theterms established by the vendor at the time you acquire this publication.U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of thissoftware and related documentation by the U.S. government is subject to the Agreementwith SAS Institute and the restrictions set forth in FAR 52.227-19 Commercial ComputerSoftware-Restricted Rights (June 1987).SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.1st printing, March 20062nd printing, October 2006SAS Publishing provides a complete selection of books and electronic products to helpcustomers use SAS software to its fullest potential. For more information about oure-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web siteat support.sas.com/pubs or call 1-800-727-3228.SAS® and all other SAS Institute Inc. product or service names are registered trademarksor trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USAregistration.Other brand and product names are registered trademarks or trademarks of theirrespective companies.

Page 3: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Contents

What’s New v

Overview v

Documentation Enhancements v

New Tools for Data Loading and Cube Building vi

New Options Added to the PROC OLAP Statement vi

New Functions vii

New Tuning Capabilities for the Query Thread Pool vii

New Tuning Options Window vii

Improved Performance vii

Improved Querying Capability viii

Improved Aggregation Tuning viii

Additional Enhancements viii

Chapter 1 � OLAP Introduction and Overview 1What Is OLAP? 1

What Is a Cube? 3

Understanding the Cube Structure 4

SAS Servers 4

Why You Should Use Cubes 6

Analyzing Your Data 7

Chapter 2 � Building Cubes 11Background 11

Defining Member Properties 13

Defining Distinct Count Measures 14

Defining a Default Hierarchy 15

Defining Multiple Hierarchies for a Dimension 15

Defining Ragged and Unbalanced Hierarchies for a Dimension 16

Cube Design-Aggregations 19

SAS OLAP Cube Size Specifications 21

Chapter 3 � Cube Building Examples 23Building a Cube from a Detail Table 23

Building a Cube from a Summary Table 32

Building a Cube from a Star Schema 38

Chapter 4 � Modifying and Updating Cubes 47Updating a Cube 48

Refreshing Cube Metadata 48

Tuning Cube Aggregations 49

Specifying Tuning and Performance Options in Cube Aggregations 52

Multiple Language Support and Dimension Table Translations 54

Page 4: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

iv

Adding SAS System Options to a Cube 55

Synchronizing a Cube 56

Exporting and Importing Cubes 56

Accessing OLAP Cubes from SAS: SQL Pass-Through Facility for OLAP 62

Specifying GIS Map Information for a Dimension 65

Specifying Calculated Members 65

Chapter 5 � Using SAS OLAP Cubes 69Using a Cube with ADO MD 69

Using a Cube with OLE DB for OLAP 69

Using a Cube with Additional SAS Products 70

Using a Cube with Third-Party Clients 73

Appendix 1 � The OLAP Procedure 77The OLAP Procedure 78

Syntax: OLAP Procedure 78

PROC OLAP Statement 79

METASVR Statement 85

DIMENSION Statement 86

LEVEL Statement 89

PROPERTY Statement 91

HIERARCHY Statement 93

MEASURE Statement 95

AGGREGATION Statement 99

DROP_AGGREGATION Statement 101

DEFINE Statement 102

UNDEFINE Statement 104

USER_DEFINED_TRANSLATIONS Statement 105

Tables Used to Define Cubes 107

Naming Guidelines for SAS OLAP Server 108

Loading Cubes 109

Maintaining Cubes 113

Specialized Options for PROC OLAP 115

Appendix 2 � SAS OLAP Cube Studio Messages 117Cube Designer Error Messages 117

Dimension Designer Error Messages 124

Specify Map Error Messages 127

Miscellaneous Error Messages 127

Appendix 3 � SAS OLAP Cube Studio Accessibility Features 129SAS OLAP Cube Studio Accessibility Features 129

Appendix 4 � Recommended Reading 131Recommended Reading 131

Glossary 133

Index 141

Page 5: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

v

What’s New

OverviewThe SAS OLAP Server enables users to develop and deploy scalable Online

Analytical Processing (OLAP) applications. In addition, automated data loading andcube building are available through the use of a new administration interface calledSAS OLAP Cube Studio, which was developed using Java technology.

OLAP queries are performed using the Multidimensional Expressions (MDX) querylanguage in client applications that are connected to the SAS OLAP Server by using thefollowing:

� the SQL Pass-Through Facility for OLAP, which is designed to process MDXqueries within the PROC SQL environment

� open access technologies such as OLE DB for OLAP, ADO MD, and Java

New and enhanced features in SAS OLAP Server include the following:� new tools for data loading and cube building� new options added to the PROC OLAP statement� new functions� new tuning capabilities for the query thread pool� new tuning options window� improved performance� improved querying capability� improved aggregation tuning� additional enhancements

Note: This section describes the features of the SAS OLAP Server that are new orenhanced since SAS 8.2. �

Documentation EnhancementsThe SAS OLAP Server: Administrator’s Guide is no longer available under that title.

The content of that document has been merged into the new administrative document

Page 6: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

vi What’s New

set for SAS Intelligence Platform. The other SAS OLAP Server documents, the SASOLAP Server: User’s Guide and the SAS OLAP Server: MDX Guide remain availableunder their existing titles.

The content of the SAS OLAP Server: Administrator’s Guide is now available in thefollowing documents:

SAS Intelligence Platform: Application Server Administration Guidedescribes the configuration, tuning, and management of SAS OLAP Servers, alongwith the other servers that are defined as part of the logical SAS ApplicationServer.

SAS Intelligence Platform: Desktop Application Administration Guidedescribes the administration of SAS OLAP Cube Studio.

SAS Intelligence Platform: System Administration Guidedescribes SAS OLAP Server monitoring, start/stop/restart, cube data import/export.

SAS Intelligence Platform: Security Administration Guidedescribes security issues for SAS OLAP cubes, including a newly updated sectionabout member-level security.

SAS Intelligence Platform: Data Administration Guidedescribes how to define libraries and schemas for SAS OLAP cubes.

The administrative document set for the SAS Intelligence Platform is available in theSAS Online Documentation at http://support.sas.com/onlinedoc/913/docMainpage.jsp.The home page for the administrative document set is available at http://support.sas.com/documentation/configuration/913admin.html.

New Tools for Data Loading and Cube Building

The OLAP procedure, in addition to cube building, includes options for handlingragged hierarchies, defining global calculated members and named sets, assigningproperties to levels, and optimizing cube creation and query performance. It alsosupports multiple hierarchies and drill-through tables.

SAS OLAP Cube Studio is an alternative Java interface to the OLAP procedure. Thisinterface is also integrated with SAS Data Integration Studio.

New Options Added to the PROC OLAP Statement

The following options have been added to the PROC OLAP statement:

COMPACT_NWAYwhen building a cube from a star schema, this option enables additionalsummarizations during the cube build that can decrease the size of the NWAYaggregation.

IGNORE_MISSING_DIMKEYS=TERSE | VERBOSEwhen building a cube from a star schema, this option enables the continuation ofthe build when the fact table is found to contain keys that are not present in anyof the dimension tables. The log receives information about the number andlocation of the missing keys.

For more information about these new options, see the SAS OLAP Server: User’s Guide.

Page 7: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

What’s New vii

New FunctionsThe following functions are new:� A Specify Map function has been added to SAS OLAP Cube Studio. The Specify

Map function enables you to store ESRI Geographic Information System (GIS)spatial map information in the SAS Metadata Repository. This GIS informationcan then be read by the SAS OLAP Server and returned during a cube query.

� The Export Cube and Import Cube functions enable you to copy cube metadatafrom a source repository to a target repository, and if needed, to another server.The Export Cube function enables you to extract a cube’s metadata from thesource repository and save it in a file that you specify. All information about acube, including its dimensions, hierarchies, levels, measures, notes, properties,calculated measures, aggregations, and security settings, will be extracted. TheImport Cube function then enables you to save the cube metadata to anothermetadata repository on another metadata server.

� The Define Distinct Count function enables you to store NUNIQUE (DistinctCount) statistics as measures with a SAS OLAP cube. You can add or delete adistinct count measure either with PROC OLAP or in the Cube Designer wizard,within SAS OLAP Cube Studio. You can add or delete a Distinct Count measure.You can also modify the name, caption, format, units, and description of themeasure.

� The Synchronize Levels function enables you to synchronize a cube when the inputtable for an existing cube has encountered a column name change. This functionfinds the name differences between the cube and its input table and changes thehierarchy level names to match the input table column names.

New Tuning Capabilities for the Query Thread PoolNew tuning capabilities for the query thread pool are now available for each of your

SAS OLAP Servers. Tuning the query thread pool enables you to optimize performancebased on the number and frequency of query requests that are received by a SAS OLAPServer.

New Tuning Options WindowA tuning Options window has been added to the Manual Tuning function and the

Advanced Aggregation Tuning plug-in. The Options window enables you to specifycertain performance options on the PROC OLAP statement when adding or modifyingaggregations for a cube. In this window you can view the current values and change thevalues when needed.

Improved PerformanceServer performance is recorded and analyzed by using the Application Response

Measurement (ARM) system.The new multi-threaded data storage and server functionality provide faster cube

performance. The data can be stored in a multidimensional form (MOLAP) or in a formthat includes existing aggregations from presummarized data sources.

Page 8: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

viii What’s New

Improved Querying CapabilityAn SQL Pass-Through Facility for OLAP is available in SAS for use in querying

cubes.A subquery cache can now be enabled, disabled, and sized for each of your SAS

OLAP Servers. The new cache stores subqueries that generate empty result sets.

Improved Aggregation TuningAggregations can be added to or deleted from existing cubes. In addition, further

enhancements for aggregation tuning have been made:� The AGGREGATION statement and SAS OLAP Cube Studio’s Manual Tuning

function have been enhanced for use with cubes that employ aggregated data fromother tables or for use with cubes that have no NWAY aggregation.

� The Advanced Aggregation Tuning plug-in provides a point-and-click interface thatenables you to create and add aggregations to the list of existing aggregations thatmight already be defined for the cube.

Additional Enhancements

� The metadata structure is improved, and metadata is stored with the cube.� Caching and logging can be enabled or disabled.� Support for ad hoc calculations and time dimensions is improved.� The start-up file generator has been removed from the SAS OLAP Server Monitor

plug-in for SAS Management Console. SAS OLAP Servers are now automaticallyinstalled as Windows services; server start-up options are set by an INI file that isinstalled by the SAS Deployment wizard.

� When creating a cube dimension in SAS OLAP Cube Studio’s Cube Designerwizard, a hierarchy for a dimension will automatically be created when nohierarchy has been explicitly defined and you click the Finish button in thiswindow. This default hierarchy includes all levels that were specified for thecurrent dimension and the order they were listed in for the dimension.

� The Calculated Members plug-in provides a point-and-click interface that enablesyou to add new measures or modify existing measures for the selected cube.

Page 9: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

1

C H A P T E R

1OLAP Introduction and Overview

What Is OLAP? 1Data Storage and Access 2

Benefits of OLAP 2

OLAP Variations 3

MOLAP — Multidimensional OLAP 3

ROLAP — Relational OLAP 3HOLAP — Hybrid OLAP 3

What Is a Cube? 3

Understanding the Cube Structure 4

SAS Servers 4

SAS Servers and SAS OLAP 4

SAS Metadata Server 5SAS Workspace Server 5

SAS OLAP Server 5

SAS Stored Process Server 6

Why You Should Use Cubes 6

Cube Usage and Storage Space Reduction 6Multi-Threading Capabilities 7

Easy Setup and Maintenance 7

Data Management: Choosing Your Own Tool 7

Analyzing Your Data 7

Data Preparation and Dimension Design 7Data Tables Used to Define SAS OLAP Cubes 8

Detail Tables 8

Fact Tables and Dimension Tables 8

Aggregation Tables 8

Drill-Through Tables 9

Aggregation Design 9

What Is OLAP?Online Analytical Processing (OLAP) is a technology that is used to create decision

support software. OLAP enables application users to quickly analyze information thathas been summarized into multidimensional views and hierarchies. By summarizingpredicted queries into multidimensional views prior to run time, OLAP tools provide thebenefit of increased performance over traditional database access tools. Most of theresource-intensive calculation that is required to summarize the data is done before aquery is submitted.

Page 10: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

2 Data Storage and Access � Chapter 1

Data Storage and AccessDecision makers are asked to make timely and accurate decisions that are based on

the past performance and behavior of an organization as well as on future trends anddirectives. To make effective business decisions, business analysts must have access tothe data that their company generates and responds to. This access must includetimely queries, summaries, and reviews of numerous levels and combinations of large,recurrent amounts of data. The information that business analysts review determinesthe quality of their decisions.

Organizations usually have databases and data stores that maintain repeated andfrequent business transaction data. This provides simple yet detailed storage andretrieval of specific data events. However, these data storage systems are not wellsuited for analytical summaries and queries that are typically generated by decisionmakers. For decision makers to reveal hidden trends, inconsistencies, and risks in abusiness, they must be able to maintain a certain degree of momentum when queryingthe data. An answer to one question usually leads to additional questions and review ofthe data. Simple data stores do not successfully support this type of querying.

A second type of storage, the data warehouse, is better suited for this. Data ismaintained and organized so that complicated queries and summaries can be run.OLAP further organizes and summarizes specific categories and subsets of data fromthe data warehouse. This results in a robust and detailed level of data storage withefficient and fast query returns. SAS OLAP cubes can be built from either partially orcompletely denormalized data warehouse tables. Stored, precalculated summarizationscalled aggregations, can be added to the cube to improve cube access performance.Aggregations can either be pre-built relational tables, or you can let the cube create itsown optimized aggregates.

Benefits of OLAPThe ability to have coherent and relevant information is the reason OLAP has gained

in popularity. OLAP systems help reveal evasive inconsistencies and trends in datathat might not have been seen before. OLAP users can intuitively search data that hasbeen consolidated and summarized within the OLAP structure. In addition, OLAP toolsallow for tasks such as sales forecasting, asset analysis, resource planning, budgeting,and risk assessment. OLAP systems also provide the following benefits:

� fast access, calculations, and summaries of an organization’s data� support for multiple user access and multiple queries� the ability to handle multiple hierarchies and levels of data� the ability to presummarize and consolidate data for faster query and reporting

functions� the ability to expand the number of dimensions and levels of data as a business

grows.

To fully understand the benefits of OLAP and the details of its effectiveimplementation, it helps to examine the technology from two perspectives—first, fromthat of the users and second, from that of the information technology (IT)administrators who are responsible for OLAP implementation. The users, typicallybusiness analysts and executives, expect the data to be organized according to categoriesthat reflect the way in which they think about the enterprise. For IT administrators,OLAP can present a long list of technical issues, including these concerns:

� storage requirements and associated costs� client and server capabilities

Page 11: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

OLAP Introduction and Overview � What Is a Cube? 3

� maintenance activities such as update and backup� performance considerations such as the amount of time that is required to build a

multidimensional model� the ability of the OLAP solution to integrate with current or planned data

warehouse strategies and architectures.

OLAP VariationsOLAP technology can be further defined by the methods for storing and accessing

data and by the performance of queries against that data. SAS OLAP supports threedifferent variations of OLAP technology:

� MOLAP� ROLAP� HOLAP

MOLAP — Multidimensional OLAPMOLAP (multidimensional online analytical processing) is a type of OLAP that

stores summaries of detail data (aggregates) in multidimensional database structures.MOLAP cubes are most suited for slicing and dicing of data and are used whenperformance and query speed is critical. A unique feature of MOLAP is that calculationsare predetermined and created with the cube. Whereas MOLAP is well suited forcomplex queries and calculations, it is limited in the amount of data it can handle.

ROLAP — Relational OLAPROLAP (relational online analytical processing) is a type of OLAP in which

multidimensional data is stored in a relational database such as a SAS table or anORACLE table. ROLAP is more scalable than other OLAP types and handles extensiveamounts of data well. Although performance can be somewhat slow, ROLAP is limitedonly by the size of the relational database it is identified with.

ROLAP data is stored in either a flat file or with a star schema. With ROLAP, eachinstance of slicing and dicing of data is part of an SQL query (or multiple SQL queries)and is comparable to a WHERE clause in the SQL statement.

HOLAP — Hybrid OLAPHOLAP (hybrid online analytical processing) is a type of OLAP in which relational

OLAP (ROLAP) and multidimensional OLAP (MOLAP) are combined. In HOLAP, thesource data is usually stored using a ROLAP strategy, and aggregations are storedusing a MOLAP strategy. It combines the best features of both ROLAP and MOLAP.This combination usually results in the smallest amount of storage space. In HOLAP,aggregates can be precalculated and can be linked into a hybrid storage model.

What Is a Cube?One of the advantages of OLAP is how data and its relationships are stored and

accessed. OLAP systems house data in structures that are readily available for detailedqueries and analytics. Cubes are central to the OLAP storage process.

A cube is a set of data that is organized and structured in a hierarchical,multidimensional arrangement. The cube is usually derived from a subset of a data

Page 12: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

4 Understanding the Cube Structure � Chapter 1

warehouse. Unlike relational databases that use two-dimensional data structures (oftenin the form of columns and rows in a spreadsheet), OLAP cubes are logical,multidimensional models that can have numerous dimensions and levels of data. Also,an organization typically has different cubes for different types of data.

One of the challenges of OLAP cube data storage and retrieval is the growth of dataand how that growth affects the number of dimensions and levels in a cube hierarchy.As the number of dimensions increases over time, so does the number of data cells on anexponential scale. To maintain the efficiency and speed of the OLAP queries, the cubedata is often presummarized into various consolidations and subtotals (aggregations).

Note: The SAS OLAP Server term cube is synonymous with the terms hyper-cubeand multi-cube. �

Understanding the Cube StructureOLAP cubes organize data in a hierarchical arrangement. Data is structured

according to dimensions and measures.Dimensions group the data along natural categories. (Examples of dimensions are

Time, Products, Organization). Typically, dimensions offer different levels of grouping(for example, the Time dimension can be grouped by Years, Months, Days, etc.). Levelsare organized into one or more hierarchies, typically from a coarse-grained level (forexample, Year) down to the most detailed one (for example, Day). The individualcategory values (for example, 2002 or 21Jan2002) are called members.

Measures are the data values that are summarized and analyzed. Examples ofmeasures are sales figures or operational costs. The data for measures is located incells. Cells are the intersection of one member for every dimension.

Presummarized data in a cube is stored in aggregations. Aggregations are the basisfor fast response to data queries in OLAP applications. An aggregation is possible ateach intersection of a level of one or more dimensions. The selection of aggregations topresummarize is one of the major factors that determine query response time and cubesize.

SAS Servers

SAS Servers and SAS OLAPSAS OLAP uses a combination of SAS servers to store cube metadata, to store the

physical cube structure, and to query cubes after they are created. Several types of SASservers are available to handle different workload types and processing intensities. Theterm server refers to a program or programs that wait for and fulfill requests fromclient programs for data or services.

The SAS servers use the SAS Integrated Object Model (IOM), which is a set ofdistributed object interfaces that make SAS software features available to clientapplications when SAS is executed on a server. Each server uses a different set of IOMinterfaces and has a different purpose. The following servers are used by SAS OLAP:

� the SAS Metadata Server� the SAS Workspace Server� the SAS OLAP Server

Page 13: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

OLAP Introduction and Overview � SAS OLAP Server 5

In addition to the other servers that SAS OLAP uses to store and process cube data,the SAS Stored Process Server is used in several different client applications thataccess SAS OLAP cubes and report on OLAP cube data.

SAS Metadata ServerThe SAS Metadata Server controls access to a central repository of metadata that is

shared by all of the applications in the system. It enables all users to access consistentand accurate data. The SAS Metadata Server stores the metadata that defines thecubes. It is a multi-user server that enables users to manage metadata in one or moremetadata repositories by using the SAS Open Metadata Interface.

Note: The SAS Open Metadata Interface is an object-oriented applicationprogramming interface (API) that interacts with the SAS Metadata Server. SAS OLAPCube Studio is an example of an application that is compliant with the SAS OpenMetadata Interface. �

The SAS Metadata Server uses the Integrated Object Model (IOM) that is providedby SAS Integration Technologies. IOM provides distributed object interfaces to BaseSAS software features. It enables you to use industry-standard languages,programming tools, and communication protocols to develop client programs that accessthese services on IOM servers.

In the SAS OLAP Server, all relevant structural information is contained within thecube and most of it is also replicated within the SAS Open Metadata Architecture. Thisis done so you can do the following:

� disassociate the cube definition process from cube creation, thus enabling you tocreate a cube by using its stored definition

� define and enforce security at the SAS Open Metadata Architecture level� manage and control the data source in the centralized SAS Metadata Repository

You can find documentation about the SAS Open Metadata Architecture in the SASIntelligence Platform: System Administration Guide and the SAS Intelligence Platform:Data Administration Guide.

SAS Workspace ServerThe SAS Workspace Server enables client applications to submit SAS code to a SAS

session using an application programming interface (API). The SAS Workspace Serverprovides access to SAS software features such as the SAS language, SAS libraries, theserver file system, results content, and formatting services.

A program called the object spawner runs on a workspace server’s host machine. Thespawner listens for incoming client requests and launches server instances as needed.You can run as many instances of workspace servers as are needed to support yourworkload.

SAS OLAP ServerSAS OLAP Server is a scalable server that provides multi-user access to the data

that is stored in SAS OLAP cubes. This server is designed to reduce the load ontraditional back-end storage systems by quickly delivering summarized views,irrespective of the amount of data that underlies the summaries.

Processing data by using a multi-threaded kernel enables you to take advantage ofyour server’s parallel processing abilities. SAS OLAP Server accepts data queries in the

Page 14: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

6 SAS Stored Process Server � Chapter 1

industry-standard MDX query language, which opens it up to a variety of clients. Thefollowing features are also included:

� the SAS OLAP Cube Studio user interface, which is an alternative Java interfacefor building and maintaining cubes

� PROC OLAP for programmatically building and maintaining cubes� server management by using SAS Management Console� support for processing external aggregates� support for OLE DB for OLAP

Note: OLAP queries are performed by using the Multidimensional Expressions(MDX) query language in client applications that are connected to the OLAP server byusing OLE DB for OLAP (an extension of OLE DB that is used by COM-based clients),or through a similarly designed Java interface. �

SAS Stored Process ServerIn addition to the other servers that SAS OLAP uses to store and process cube data,

the SAS Stored Process Server is used to execute SAS Stored Processes. A storedprocess is a SAS program that is stored on a server and can be executed as required byrequesting applications. SAS Stored Processes can be used in several different clientapplications that access SAS OLAP cubes and report on OLAP cube data, including thefollowing:

� SAS Enterprise Guide� SAS Data Integration Studio� SAS Information Map Studio� SAS Web Report Studio

The ability to store your SAS programs on the server provides an effective method forchange control management. For example, instead of embedding the SAS code intoclient applications, you can centrally maintain and manage this code from the server.This gives you the ability to change your SAS programs and at the same time ensurethat every client that invokes a stored process will always get the latest versionavailable.

Stored process servers have MultiBridge connections, which enable multipleprocesses on different ports of the same server. A program called the object spawnerruns on a stored process server’s host machine. The spawner listens for incoming clientrequests and launches server instances as needed.

Why You Should Use CubesSAS cubes are designed to offer efficient data storage, fast data access, easy data

maintenance, and flexibility in data management. The following sections explore cubesand multidimensional storage.

Cube Usage and Storage Space ReductionWhile cubes are the format of choice to guarantee fast query response times against

your data warehouse, SAS OLAP cubes are also often a very space efficient choice fordata storage. In many cases, a basic cube without additional aggregations can besmaller than the input data because the process of creating the cube consolidates

Page 15: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

OLAP Introduction and Overview � Data Preparation and Dimension Design 7

records. SAS OLAP cubes use the hierarchy information for efficient aggregationsstorage. SAS OLAP cubes also deal efficiently with data sparsity by using virtualplaceholders for empty cells. This removes the need for any physical representation ofempty cells. A good rule of thumb is, the larger your input data, the greater the storagegain by loading data into a cube.

Multi-Threading CapabilitiesLoading data into cubes and executing queries against the cube take advantage of

the multi-threading capabilities of your server machine. Aggregations are created inparallel at cube build time. The creation of individual aggregations takes advantage ofthe Parallel Group-By capabilities of SAS’ data engine. At query execution, themulti-threading capabilities of your server machine are fully used to concurrently servequeries by multiple users. Both query evaluation and data access are executed inparallel. To further increase query performance and reduce disk access, you can allocateadditional memory on your server to be used for an in-memory aggregation cache.

Easy Setup and MaintenanceA cube is the physical representation of your logical dimensional model. The tools

that are provided to update and maintain the cube reflect the multidimensional model,which makes both setup and maintenance of your cube as intuitive as possible. SAS’thin-client, Web-based administrator interface, SAS Management Console, enables youto set up and manage OLAP servers. SAS OLAP Cube Studio provides the workspaceand cube designer tools that you need to create and maintain cubes. You can also usethe SAS OLAP procedure to create and maintain cubes in a batch environment.

Data Management: Choosing Your Own ToolIf you create your own aggregations by using data management tools such as SQL,

PROC SUMMARY, or the tools of your preferred relational database managementsystem (RDBMS), then you can link those aggregations to your cubes withoutreplicating the data within the cube. Any queries against those aggregations areexecuted by the appropriate SQL engine, and take advantage of any capabilities thatengine might have. This allows you the flexibility to use the data management tools ofyour choice. It also allows you to distribute your data for your cube aggregations acrossmultiple database systems, servers, and platforms. If you choose to let the cube buildercreate the aggregations, then you can control where to store the data and index files foreach aggregation.

Analyzing Your Data

Data Preparation and Dimension DesignThe goal of an OLAP system is to have data that is organized, available, and

presented as relevant information to decision makers. OLAP cubes are based on datafrom data warehouses. A data warehouse consists of data that is extracted from

Page 16: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

8 Data Tables Used to Define SAS OLAP Cubes � Chapter 1

transactional systems at regular intervals. The extraction process works very closelywith data quality control, making sure that the data is complete and accurate.Extensive data cleansing (which includes eliminating variant spellings of names) can bepart of this task.

Building a data warehouse also implies transforming data that is optimized fortransactional processing into data that is optimized for user-driven analysis. Part ofthat process is grouping facts and attributes into entities that correspond to the users’view of the organization. These groupings are known as dimensions. For relatedinformation, see the SAS online documentation for SAS Data Integration Studio.

An established technique for implementing a dimensional model is to create star joinschemas that are based on the data. SAS OLAP cubes can be loaded from star schemas,or from further denormalized tables or views that include some or all dimensions in thefact table.

Data Tables Used to Define SAS OLAP Cubes

Detail TablesA detail, or base, table is any table defined in a SAS Metadata Repository that

contains the measures and levels for a cube. The detail table consists of unsummarizeddata that must include one column for each level and one numeric analysis column foreach set of measures that will be generated.

Fact Tables and Dimension TablesA star schema uses a set of input tables that are defined in the SAS Metadata

Repository. The set of tables includes a single fact table and one or more dimensiontables. The fact table must contain one numeric analysis column for each set ofmeasures that will be generated. For levels, the fact table will either contain thecolumns for the levels of a dimension or it will contain a key column that links the facttable with a dimension table that contains the columns for the levels of a dimension.These statements are also true for star schemas:

� A dimension can be in the fact table. In this case, all the level columns are in thefact table and no fact or dimension key is required.

� If the dimension levels are defined in a dimension table, all the level columns forthat dimension must be contained in the same dimension table.

� Both the dimension keys and fact keys are single columns, not combinations ofcolumns.

� The dimension key can also be a level in the dimension.

Aggregation TablesAggregation tables are fully summarized external relational tables that are used to

build cubes. All aggregation tables must contain a column for each measure in the cubewhere the statistic for the measure is one of the following: N, NMISS, SUM, MAX,MIN, or USS. Columns for derived measures cannot be stored on the aggregation tableand are ignored if they exist. Derived measures are always computed at query time. Anaggregation table can be used in two ways:

� as an NWAY data source for the cube. In this case, the table must contain acolumn for every level in the cube and a column for every stored measure.

Page 17: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

OLAP Introduction and Overview � Aggregation Design 9

� as a subaggregation for the cube. In this case, the table must include a column foreach level of the aggregation and a column for every stored measure.

Drill-Through TablesDrill-through tables are views maintained by the user that represent all of the input

data used to define a cube. The drill-through table name can be set either when thecube is first created or during an update. Drill-through tables can be used by clientapplications to provide a view from processed data into the underlying data source.

Aggregation DesignEfficient drilling or traversing of the cube data is a key factor in flexible and quick

decision making and analysis. In order to maintain speed and consistency in reporting,data is usually precalculated or aggregated. An important factor in query performanceis good aggregation design, which includes decisions about total storage space, availablebuild time, storage location, and storage format.

When planning your data storage and design, it is helpful to approximate the size ofaggregations. A basis for estimating aggregation size is the number of distinct values ina dimension level, otherwise known as cardinality. The other factor that determinesaggregations size is density. Density is a measure of how many members of eachdimension in an aggregation occur in combination with the members of the otherdimensions (for example, there might not be sales of a specific product on a specificdate). The total cube size as well as the resources that are available for the cube buildprocess determine the build time that is needed. It is also important to note that buildtime should not exceed the cube update interval.

Aggregation size and available hardware influence your choices for aggregationpartitioning. You can separate aggregations into multiple files. A reduced file sizemight accelerate OLAP server access time, particularly if multiple processors areavailable for multi-threaded processing. You can use preaggregated summary tables,the cube’s own efficient aggregation storage, or a combination of both. Using indexes oneither storage type might increase query performance, while also increasing storagespace and build time.

After an initial aggregation design is chosen, subsequent cube builds enable you tooptimize the cube’s performance and size by adding or removing aggregations. You cananalyze the OLAP users’ behavior by using Application Response Measurement (ARM)logs, showing which aggregations are needed most and would be the most efficient.

Page 18: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

10

Page 19: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

11

C H A P T E R

2Building Cubes

Background 11Preparations for Building a Cube 12

Storage Location Requirements for Cube Metadata and Related Objects 13

Defining Member Properties 13

Property Statement 14

Cube Designer 14Defining Distinct Count Measures 14

Defining a Default Hierarchy 15

Defining Multiple Hierarchies for a Dimension 15

Hierarchies Statement 16

Cube Designer 16

Defining Ragged and Unbalanced Hierarchies for a Dimension 16Defining Ragged and Unbalanced Hierarchies in SAS OLAP Cube Studio 17

Defining Ragged and Unbalanced Hierarchies with PROC OLAP 17

Ragged Hierarchies and Unique Member Names 19

Cube Design-Aggregations 19

MOLAP Aggregation Storage 20ROLAP Aggregation Storage 20

Choosing MOLAP or ROLAP Aggregation Storage 20

SAS OLAP Cube Size Specifications 21

Background

At this point in the cube-building process, the collecting and scrubbing of the datashould be finished as well as planning a dimensional design. After you have collectedand analyzed your data, you are ready to create the cube. When you define the cube,you define the dimensions and measures for the cube along with information about howaggregations should be created and stored. There are two methods of creating a cube:

� You can submit PROC OLAP code by using either the SAS Program Editor or abatch job. If you use PROC OLAP, the cube is created, and then the cubedefinition is stored in a metadata repository. This is referred to as the “long” formof PROC OLAP.

� You can use the Cube Designer interface in SAS OLAP Cube Studio to define andcreate the cube. The Cube Designer first stores the cube definition in a metadatarepository, and then submits a shorter form of PROC OLAP code to create thecube. This is referred to as the “short” form of PROC OLAP.

Note: The Cube Designer can also be launched from SAS Data Integration Studio. �

Page 20: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

12 Preparations for Building a Cube � Chapter 2

Preparations for Building a CubeTo build a cube by using either PROC OLAP or SAS OLAP Cube Studio, you must

complete several preliminary tasks:� Configure a metadata server.� Define an OLAP server in the metadata. The server does not need to be running

to create cubes, but it must be defined in the metadata.� Analyze the data to determine the location of the table(s) that will be used to build

your cubes and what dimensions and measures will be created.� Define the table(s) that will be used to create the cube in the metadata. You do

this by using SAS Data Integration Studio or by using SAS OLAP Cube Studioand SAS Management Console as follows:

� Use SAS Management Console to define, in the metadata, the server that willbe used to access the tables. This is a SAS application server with aworkspace server component.

� Use SAS Management Console to define, in the metadata, the SAS librarythat contains the table.

� In SAS OLAP Cube Studio, specify the server that will be used to access thetables. To set the server, select Tools � OptionsOr, if the shortcut bar isdisplayed, select Options to set the server.

� In SAS OLAP Cube Studio, select Source Designer to load the tabledefinitions (or other information source) as follows:

� From the shortcut bar, select Tools � Source Designer or selectSource Designer

� Select a Source Type (SAS, ODBC, etc.), and then select Next.� If you have not specified a server, or if the server that is specified is not

valid, then you will be prompted again for a server.� Select the SAS Library that contains the tables that you want to define,

and then select Next.� Select the tables to define, and then select Next.� Select Finish. The table definitions are loaded into the metadata.

� If you start to create a cube and do not see the table that you need tocontinue, then you can select the Define Table button in any of thewindows that prompt for tables.

� In the Finish window of the cube designer, you are given the option to create thephysical cube. The metadata definition is always stored as you leave the Finishwindow. However, you can defer creation of the physical cube. If you choose tocreate the cube as you leave the Finish window, then you must have a SASWorkspace Server defined that you can submit PROC OLAP code to. This server isdefined in SAS Management Console.

Note: For further information about the different data types that you can use toload cubes from, see “Loading Cubes” on page 109. �

Note: The SAS Metadata Server enables duplicate librefs to be defined in themetadata. To ensure that the correct SAS library definition is found on the metadataserver, you should assign the libref by using the LIBNAME statement for the metadataengine before submitting the PROC OLAP code. Otherwise, PROC OLAP will select thefirst library definition that it finds with your specified libref, and it will associate your

Page 21: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Building Cubes � Defining Member Properties 13

cube metadata with that definition. The selected library definition might or might notcontain a description of the SAS data set that was actually used to build your cube. Formore information about using the LIBNAME statement for the metadata engine, see“Statements” in SAS Language Reference: Dictionary. �

Note: When a SAS OLAP cube is created, a directory for that cube is also created.This directory is assigned the same name as the cube, but in uppercase letters. Forexample: When you save a cube in c:\olapcubes and name the cube Campaigns, thecube is saved in the directory c:\olapcubes\CAMPAIGNS. �

For further information about preliminary setup and configuration steps see the SASIntelligence Platform: System Administration Guide and the SAS Intelligence Platform:Data Administration Guide.

Storage Location Requirements for Cube Metadata and RelatedObjects

When storing metadata that describes a cube, the metadata objects that describe thecube and the cube’s associated libraries and source tables must be stored in the samerepository, or the metadata that describes the cube must be in a custom repository thatis dependent on the repository that contains the library and table objects. Otherwise,you will not be able to create the cube. In addition, the library and table objects thatare referenced by a cube must always be in the same repository. The following optionsillustrate these conditions:

� The library, table, and cube objects can be in a Foundation repository.� The library, table, and cube objects can be in Project A, which is dependent on the

Foundation repository.� The library and table objects can be in the Foundation repository, and the cube

object can be in Project A.� The cube object cannot be in the Foundation repository, and the library and table

objects cannot be in Project A.� The table object cannot be in the Foundation repository, and the library and cube

objects cannot be in Project A.� The library object cannot be in the Foundation repository, and the table and cube

objects cannot be in Project A.

Defining Member PropertiesWhen you create a SAS OLAP cube, the information that is relevant to the cube is

defined with the cube hierarchy, measures, and aggregations (summaries) that will bestored with the cube. Additional information that is part of the cube member data canbe included in the cube definition as a member property.

Member properties are attributes of dimension members that provide an additionalgradation of information to users of the cube data. Member property information isusually not as significant as the levels and members within a dimension, and therefore,does not qualify as a level or member. However, it often has additional analytical valuethat can be useful at query time.

A member property is assigned to a level within a hierarchy, and a level can havemultiple properties that are assigned to it. For hierarchy placement, a memberproperty is assigned (by default) to all hierarchies that the select level is in. However,you can remove one or more (but not all) of the hierarchies that the member property isassigned to.

Page 22: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

14 Property Statement � Chapter 2

When you create a member property, you must specify the name, column, and level.Member property names can be shared across a cube but must be unique for a specificlevel within a specific hierarchy. You can also specify a caption, description, and format.The format that you specified here will be used instead of the format in the data set.

Property StatementThe PROPERTY statement is used with the PROC OLAP statement when you define

a cube:

PROPERTY zipcode-regioncolumn=post_codehierarchy=geographiclevel=region;

Cube DesignerYou can also establish member properties with the Member Property dialog box that

is part of the Cube Designer interface in SAS OLAP Cube Studio. This is accessed aftermeasures are defined, when you create a cube or edit a cube. Select Add to create amember property. At the Define a Member Property dialog box, enter the memberproperty name, level, column, and caption.

Defining Distinct Count MeasuresYou can define distinct count statistics as measures with a cube using either the SAS

OLAP Cube Studio, Define Distinct Count Measures function or the PROC OLAPMEASURE statement and the NUNIQUE statistic.

Define DistinctCount Measures

You can define a distinct count statistic on the Cube Designer wizardin SAS OLAP Cube Studio. On the Select Measures window, clickthe Define Distinct Count button. The Define Distinct CountMeasures window opens. This window enables you to storeNUNIQUE (Distinct Count) statistics as measures with a cube. Youcan add or delete a Distinct Count measure on this window. Tocreate the Distinct Count measure, select the level and hierarchy forthe new measure. Selecting the level in a tree structure (dimension,hierarchy, level) will automatically assign the dimension andhierarchy to that measure. A name will automatically be generatedfor the Distinct Count measure consisting of the level name,“NUNIQUE”, and the parent hierarchy name. By default, DistinctCount measures will have the word “NUNIQUE” in their measurename.

Note: Only one level-hierarchy combination can be defined for ameasure. After a level-hierarchy combination has been used tocreate a Distinct Count measure, the combination cannot be usedagain. �

Note: If the level or hierarchy is deselected, then any associateddefined Distinct Count measures will be deleted from the cube. �

You can modify the name, caption, format, units, and descriptionfor a Distinct Count measure in the Cube Designer - Measure

Page 23: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Building Cubes � Defining Multiple Hierarchies for a Dimension 15

Details window. Distinct Count measures are displayed on the Editdetails for each measure table with the other selected measures.The Distinct Count measures are also listed on the DefaultMeasure drop-down box and can be selected as a default measure.

NUNIQUE You can define a distinct count statistic using the MEASUREstatement and the NUNIQUE statistic. The LEVEL andHIERARCHY options for the MEASURE statement are used withthe NUNIQUE statistic and will be ignored for non-NUNIQUEstatistics if specified.

Note: The LEVEL name is optional. If it is omitted then thelevel name is assumed to be the name specified for the NUNIQUEmeasure. The HIERARCHY name is only required if the level is inmultiple hierarchies. For further information about using theNUNIQUE statistic see the “MEASURE Statement” on page 95. �

Defining a Default HierarchyWhen you define cube dimensions, levels, and hierarchies in SAS OLAP Cube Studio,

a default hierarchy for a dimension will automatically be created if a hierarchy is notexplicitly defined. This default hierarchy includes all levels that were specified for thecurrent dimension and the order they were listed in for the dimension. In addition, ifyou define multiple hierarchies and do not select a default, then the default isautomatically assigned to the first hierarchy that is created for the dimension. On theDimension Designer — Hierarchy window, you can click the Default button to set aselected hierarchy as the default for the dimension.

Defining Multiple Hierarchies for a DimensionSAS OLAP cubes are organized into dimensions and levels of data. The levels are

then arranged into hierarchies. After an initial hierarchy has been created, you candefine additional hierarchies for a single dimension of a cube. This enables you to havemultiple possible drill paths of the same data. When you create more than onehierarchy for a dimension, the levels have some restrictions:

� A level in a dimension might be used in more than one hierarchy within thatdimension. However, levels cannot be used in hierarchies that are not definedwithin the dimension that the level is defined in.

� Each level must be used in at least one hierarchy.� Levels from the same dimension that are picked for an aggregation must be in the

drill order for at least one hierarchy in that dimension.� You cannot share levels between dimensions.

You can arrange the levels in a hierarchy in any order. The one exception to this isthe Time dimension. Levels in hierarchies in the Time dimension must follow aprescribed order that is determined by the numerical value that is assigned to the type.This order is from the smallest value (Years, 16) to the greatest value (Seconds, 3,096).You can only have one time dimension for a cube. The dimension hierarchies also havesome restrictions:

� The first hierarchy that is defined for the dimension is designated as the default.When there are multiple hierarchies, you can designate the default hierarchy forthe dimension.

Page 24: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

16 Hierarchies Statement � Chapter 2

� Hierarchy names must be unique across the cube. If there is a single hierarchy fora dimension, then its name must be the name of the dimension. Also, dimensionand hierarchy names cannot be the same as a level name within that dimension.

� For any cube loaded with a star schema, in which a dimension table representsmultiple hierarchies for that dimension, the dimension key that is used to join thedimension table to the fact table will be used for all hierarchies of that dimension.

Hierarchies StatementThe HIERARCHY statement is used with the PROC OLAP statement when you

define a cube:

hierarchy campaignslevels=(campaign_type campaign sub_campaign);

Cube DesignerYou can establish multiple hierarchies by using the Cube Designer - Dimensions

window, which is located in the SAS OLAP Cube Studio Cube Designer. To add ahierarchy to an existing dimension, select a dimension, and then click Modify. Thisopens the Dimension Designer - General window. It is populated with the values for theselected dimension. Select Next until you reach the Dimension Designer - Hierarchywindow. Select Add to create an additional hierarchy.

Note: You can modify existing hierarchies by selecting a hierarchy and clickingModify. You can also assign a default hierarchy by selecting a hierarchy and clickingDefault. The first hierarchy is automatically the default hierarchy. �

Note: An exception to defining multiple hierarchies for a dimension is the Timedimension. Levels in hierarchies in the Time dimension must follow a prescribed orderthat is determined by the numeric value that is assigned to the type. This order is fromthe smallest value (Year, 16) to the greatest value (Seconds, 3,096). �

In the Dimension Designer - Define a Hierarchy window, you can define a newhierarchy and select the different levels and their order for the hierarchy.

Defining Ragged and Unbalanced Hierarchies for a DimensionDimension levels are arranged in one or more hierarchies. Hierarchies, by process of

ordering, have a branching arrangement, and the different member levels have parentand child relationships. For instance, at company X the sales staff are located indifferent regions and cities in different countries. A balanced hierarchy might look likethis:

� Global sales president (top of hierarchy)� Sales presidents (per country)� Regional sales managers� City sales managers.

Because of differences in the cube data, hierarchies are often not balanced and possiblyhave missing members. For example, some sales regions might not have sales managersassigned to a specific city. Or, some countries might not have sales regions, just cities.These real-world scenarios would create hierarchies that have missing member dataand possibly ragged hierarchies. This affects the drillpath of the cube data.

Page 25: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Building Cubes � Defining Ragged and Unbalanced Hierarchies with PROC OLAP 17

You can also drill to missing members within a path and continue to drill down tomembers that are present.

Defining Ragged and Unbalanced Hierarchies in SAS OLAP Cube StudioThe Cube Designer in SAS OLAP Cube Studio enables you to specify the missing

members for a hierarchy and the type of data that is missing. Here are the CubeDesigner windows that enable you to specify missing member information:

RaggedHierarchies

Located in the Cube Designer General - Advanced Cube Optionswindow, this tab enables you to specify character and numericmissing member information. By default, no missing memberinformation is indicated with the value None.

DimensionDesigner - LevelProperties

� Ragged - Ignore Missing Members specifies whether toignore or use global or hierarchy-specific ragged hierarchysettings. To ignore settings, set this property to True. To usethe settings, set this property to False. By default, this is setto False.

� Ragged - Designate Missing Members specifies that theCube Designer use the specified string to identify missingvalues and override any global or hierarchy-specific raggedhierarchy settings. You can use up to 256 characters. Thevalue of the True/False setting in Ragged - Ignore MissingMembers controls whether or not you override any global orhierarchy-specific ragged hierarchy settings.

DimensionDesigner -Define aHierarchy

You can select one of these options from the Ragged Hierarchies tab:� Ignore. From this drop-down list, select True to ignore the

global missing member settings that you entered at theAdvanced Cube Options dialog box. Select False to use theglobal settings for the current hierarchy.

� Character. For this hierarchy only, enter a maximum of 256characters that will be used to identify missing charactermembers.

� Numeric. For this hierarchy only, enter a maximum of 256characters that will be used to identify missing numericmembers.

Defining Ragged and Unbalanced Hierarchies with PROC OLAPTo create ragged and unbalanced hierarchies with PROC OLAP, you specify options

that allow the procedure to skip over members of levels that have captions withspecified values. The presence of these skipped members constitutes a ragged orunbalanced hierarchy. In a ragged hierarchy, skipped members in a given level canhave descendants; skipped members are used to enable drill-down through emptylevels. In an unbalanced hierarchy, the skipped members do not have descendants;members are skipped in order to create hierarchies where certain branches do extend toall available levels.

For an example of the creation of a ragged hierarchy, assume that a cube definesinformation about sales representatives. The Geography hierarchy is defined to havethe levels Country, State, Region, and City. In this particular sales organization, the

Page 26: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

18 Defining Ragged and Unbalanced Hierarchies with PROC OLAP � Chapter 2

state of Nebraska has no regions, but it does have sales representatives in a number ofcities. This ragged hierarchy can be shown as follows:

Cube Sales Representatives

Hierarchy ...Geography...|

Levels: |Country ...USA...

|State ...Montana Nebraska North Carolina...

| | | | | |Region East West --0-- Central East West

| | | | | |City | Billings... | | | Asheville...

| | | Greenville...Helena... | Charlotte...

|...Council Bluffs, Lincoln, Sioux City...

The Geography hierarchy is ragged because of the need to skip the Region level, andbecause the skipped member (Nebraska) has descendants.

To create the ragged hierarchy shown above, the Nebraska member needs to bedefined with one member at the Region level. That member needs to have a captionthat matches the value of the EMPTY_CHAR= option that is defined in the respectiveHIERARCHY statement (for option details, see “The OLAP Procedure” on page 78).

In the resulting cube, drilling down from Nebraska takes you directly from the Statelevel to the City level.

For an example of the creation of an unbalanced hierarchy, assume that a cube namedEmployees has a hierarchy named Organizations. In that hierarchy there are variousdivisions, departments, and groups. As show below, some departments lack groups:

Cube Employees

Hierarchy ...Organizations...|

Levels: |Div ...R&D Sales Tech Support...

| | |Dept Java Platform | Java Support Platform Support

| | | | |Group | | | --0-- --0--

| | || | Global Marketing U.S.| || Hosts Performance Unit Test|

Client Mid-Tier Server

The preceding hierarchy is unbalanced because the Tech Support level has nodescendants at the Group level. To implement this unbalanced hierarchy, the levelsJava Support and Platform Support would have to be defined with captions thatmatched the value of the EMPTY= option in their respective LEVEL statements.

The options that implement ragged and unbalanced hierarchies are found in thePROC OLAP statement, HIERARCHY statement, and LEVEL statement. In the PROCOLAP and HIERARCHY statements you can specify separate caption values for

Page 27: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Building Cubes � Cube Design-Aggregations 19

character and numeric levels using the options EMPTY_CHAR= and EMPTY_NUM=.Similarly, the EMPTY= option of the LEVEL statement allows you to specify separatevalues for each level in a hierarchy, regardless of any similar values that were specifiedin preceding HIERARCHY and PROC OLAP statements.

The HIERARCHY and LEVEL statements also provide the IGNORE_EMPTY option,which specifies that any prior specifications of EMPTY_CHAR= or EMPTY_NUM= areto be ignored for that hierarchy or level.

Ragged Hierarchies and Unique Member NamesIn a ragged hierarchy, the parent of a member might not be at the level directly above

that member. Furthermore, not all children of a member are necessarily at the samelevel. This can lead to a situation where two children have the same unique name.

For example, in a geography hierarchy you might have the levels state, county, andcity. The state Washington might have a child at the county level called Olympia andanother child at the city level, also named Olympia. The city member is not adescendant of the county member of the same name. It is a child of Washington.

In a ragged hierarchy, levels can have an unconventional structure, and unpopulatedlevels are not assigned a token or placeholder. As a result, the unique name for thecounty member is Geography.[All Geography].Washington.Olympia, and theunique name for the city member is Geography.[AllGeography].Washington.Olympia.

The result of this anomaly is that the city member cannot be asked for by a uniquename in a query, either through MDX or an OLE DB for OLAP (ODBO) request formetadata. It will be returned in any set that contains it so the data that is associatedwith it is not lost. The same applies to the children of a member such as Olympia.Because the server searches through the hierarchy to validate member names, arequest by name for a child of Olympia the city will result in a bad member name error.This is because the server actually searches under the county Olympia.

This situation occurs only when two members with the same name share a parent.Any number of Olympia(s )could exist under other parents with no unusual results.

Cube Design-AggregationsWhen determining how to efficiently deliver the data in a multidimensional cube,

fast query response is extremely important. This is accomplished by storingsummarized data. Any combination of dimension levels can become a storedaggregation. Which aggregations are being stored has a direct effect on the SAS OLAPServer CPU usage, file I/O, and query response times. The aggregations that are beingstored also affect cube build time and the absolute cube file size. Therefore, it is atrade-off between a single instance of resource use at cube build time and multipleinstances of resource use at cube query time.

The aggregated data values for SAS OLAP cubes can be stored either with the cubein the cube’s internal format or external to the cube in relational summary tables.

MOLAP MOLAP aggregation storage is the cube-internal storage foraggregations. MOLAP aggregation tables are created as part of thecube creation step.

ROLAP ROLAP aggregation storage is the cube-external summary tables.ROLAP summary tables need to be pre-calculated from the inputdata (using tools such as SQL or PROC MEANS/PROC SUMMARY)and made known to the cube at cube creation time.

Page 28: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

20 MOLAP Aggregation Storage � Chapter 2

MOLAP Aggregation StorageSAS MOLAP aggregation storage maintains the cube data in the same table format

as the format that is used by the SAS Scalable Performance Data (SPD) Engine.MOLAP aggregation storage takes advantage of key contraction and allows data accessby using the cube’s internal data representation directly.

MOLAP aggregation storage of SAS OLAP cubes has the same threading andscalability features as the files used by the SAS SPD Engine. The data and the indexsection of the files are stored in different physical files. This enables parallel access tothe data and index sections. The data and index files themselves are stored inpartitions, enabling parallel data retrieval within the same file. The partitions of thedata and the index section can be distributed over multiple disc controllers, thus addinga further boost to the threaded and partitioned architecture by reducing contention andpossible bottlenecks in the physical I/O.

ROLAP Aggregation StorageROLAP tables used in SAS OLAP cubes can be SAS data sets, SAS data views, or

any tables or views accessible through a SAS engine. This extends the choice ofavailable storage options for SAS OLAP cubes to include SPDE, SPDS, and anyRDBMS product for which a SAS/ACCESS software product is available. ROLAPaggregation tables must conform to the structure of the input data. The columns thatfeed the dimension levels must have the same column names and attributes that wereused in the input data when loading the cube. In addition, all aggregations must bestored in fully de-normalized form. Here are some guidelines to make aggregationcolumns for measures available:

� Each ROLAP aggregation table must include all columns for the cube’s measureswith stored statistics.

� SAS OLAP cube aggregations store the following statistics: SUM, N, NMISS, USS,MIN, and MAX. Other available statistics are derived from the stored statistics byinternal calculations. For example, in order to include a measure for the AVGstatistic in your cube, you need to make columns available in your ROLAPaggregation tables that were generated by using SUM and N (count).

ROLAP data requests can also run against the data that was used to create and loadthe cube, whether from a detail table or a star schema. The cube’s input data can beused in place of the aggregation with the combination of the lowest level of alldimensions (often called NWAY or NWAY aggregation, which is a name borrowed fromPROC MEANS/PROC SUMMARY where it denotes the combination of all CLASSvariables).

Choosing MOLAP or ROLAP Aggregation StorageMOLAP aggregation storage is optimized for SAS OLAP Server internal processing

and has a minimal data-size footprint. It uses threaded, parallel data access and istunable to any hardware environment. MOLAP aggregation storage is convenientbecause it doesn’t require additional data management steps.

ROLAP aggregation storage enables you to use existing ROLAP schemas and reuselegacy SAS OLAP Server SAS 8 HOLAP structures. ROLAP aggregation storageenables users to use database systems and data servers of their choice to store andserve cube aggregation data. Existing processes can be used to create and accessaggregation data to off-load and distribute data access, I/O, and rollup to serversystems of the user’s choice.

Page 29: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Building Cubes � SAS OLAP Cube Size Specifications 21

A hybrid approach is possible. For example, users with existing ROLAP structurescan build a “light” SAS OLAP cube with no additional stored aggregations and addMOLAP aggregations to further tune the cube performance.

SAS OLAP Cube Size SpecificationsWhen creating SAS OLAP cubes there are some size specifications for the various

components of the cube.

Dimensions and hierarchiesA cube can have a maximum of 128 hierarchies. The number of dimensions is 128or less, if multiple hierarchies per dimension are used. There is no limit to thenumber of hierarchies per dimension.

LevelsThe maximum number of levels for a cube is 256. There can be up to 19 levels perhierarchy.

MembersThere is no limit to the number of members per cube. An individual hierarchy hasan upper limit on the number of members. This limit is determined by thefollowing formula:

log2(numer members in first level of hier)+log2(number membersin second level of hier)+.....+log2(number members in nth levelof hier) must be < 64

MeasuresThe maximum number of measures per cube is 1024.

Number of cubes per schemaWhereas there are no absolute restrictions for the number of cubes per OLAPSchema, assigning a large number of cubes to a schema should be avoided. This isbecause the cubes compete for the OLAP server’s cube cache and data cache at thetime they are accessed and handled by the server.

PropertiesThe maximum number of properties per level is 256.

Page 30: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

22

Page 31: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

23

C H A P T E R

3Cube Building Examples

Building a Cube from a Detail Table 23SAS OLAP Cube Studio 23

Saving a Cube’s PROC OLAP Code 26

PROC OLAP 27

Building a Cube from a Summary Table 32

Building a Cube from a Star Schema 38

Building a Cube from a Detail Table

SAS OLAP Cube StudioYou can build an OLAP cube by using the Cube Designer in SAS OLAP Cube Studio.

In this example, we are using data from a recent product marketing campaign. Wewant to establish measures and summaries of various aspects of our data such asgeographic location of potential customers, age of potential customers, and revenuesummaries. Our data is held in a detail table called olapsio.campnrml.

1 Define the metadata profile. The File menu options for New Metadata Profile andOpen Metadata Profile allow you to define and connect to a metadata server. Atthe Open a Metadata Profile dialog box, you can choose to either create a newmetadata profile or edit an existing one. Enter the machine information of themetadata server that you will connect to and retrieve a data source from.

� At the Connection Information dialog box, enter the machine ID, port, youruser ID, and password.

Note: These options are the equivalent of the METASVR statementoptions:

� HOST=� PORT=� USERID=� PW=.

� At the Repository Selection dialog box, select a default repository.

2 Enter general cube information.� After you have established a metadata server, you can begin to create a cube.

Select Cube Designer from the shortcut menu. At the Cube Designer –

Page 32: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

24 SAS OLAP Cube Studio � Chapter 3

General dialog box, enter the general cube information. For input type, youselect Detail Table.

� Cube Name

� Description

� Repository

� OLAP Schema

� Path in the file system to store the cube

� Input Type

Note: These options are equivalent to the PROC OLAP and METASVRstatement options:

� CUBE=

� DESC=

� REPOSITORY=

� OLAP_SCHEMA=

� PATH=.

� At the Cube Designer – Input dialog box, select a data source or detail tablefor your cube. If one does not exist for your data, select Define Table, andthen define the source that you will import your metadata from.

Note: These options are equivalent to the

� Source Designer function in the Tools Menu

� DATA|FACT= option for PROC OLAP.

� At the Cube Designer - Drill-Through dialog box, you select or define anoptional drill-through table. Drill-through tables can be used by clientapplications to provide a view from processed data into the underlying datasource.

If a drill-through table does not exist for your data, select Define Table,and then define the source that you will import your metadata from.

Note: These options are equivalent to the

� Source Designer function in the Tools Menu

� DRILLTHROUGH_TABLE | DT_TABLE | DT_TBL= option for PROC OLAP.

The Table Options button that is available at both the Cube Designer - Inputand the Cube Designer - Drill-Through dialog boxes, opens the Table Optionsdialog box. It enables you to specify data set options that are used to open thedata set. For example, you could enter a WHERE clause or subsetting informationthat is then applied to the selected table when it is opened. The options are storedas part of the cube and then reapplied when the data is accessed at run time. Youcan also specify data set options in the Dimension Designer – General window (foruse with star schemas) and the Stored Aggregates window (for use withsummarized tables). For more information, see “Data Set Options” in SASLanguage Reference: Concepts.

Page 33: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � SAS OLAP Cube Studio 25

3 Define dimensions, levels, and hierarchies. Now that your basic metadata serverand cube information has been entered, you can define the different dimensionsand their respective levels and hierarchies. For this example, you will define thefollowing dimensions and levels:

� Campaigns� campaign type

� campaign

� subcampaign.

� Campaign Dates

� campaign start year� campaign start month

� campaign start day.

� Geographic

� division

� region� client_id.

� Customer Age

� age group1

� age group2.

� Products

� product group� product type.

Define the dimensions for the cube. For each dimension you will define thedimension, its levels, and its hierarchies.

� At the Cube Designer - Dimensions dialog box, select the Add button. Thisopens the Dimension Designer - General dialog box. Enter the followinginformation:

� dimension name� caption

� description

� type of dimension (standard or time)� sort order.

Note: If you are using a star schema, enter the Dimension TablesDefinition information. �

� Select Dimension Levels from the Dimension Designer - Levels dialog box.

� Next, define properties such as format, time type, and sort order from theDimension Designer - Level Properties dialog box.

� Next, define hierarchies for the levels from the Dimension Designer - Define aHierarchy dialog box.

� Repeat this process for each dimension.

Note: Use the DIMENSION, HIERARCHY, and LEVEL statements here. Fortime-specific levels in a dimension, the LEVEL statement is required. Also, therecan be only one time-specific dimension and one GEO-specific dimension percube. �

Page 34: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

26 SAS OLAP Cube Studio � Chapter 3

4 Define measures. You can now define the measures for the cube. In your example,you want measures for revenue totals and the number of customers you trackedduring the campaigns. Define the measures for the cube at the Cube Designer -Select Measures dialog box.

Modify any measure attributes such as Measure Captions and Formats at theCube Designer - Measure Details dialog box.

Note: The MEASURE statement is used here. �

5 Define member properties. You can now define the member properties for anyneeded cube members. A member property is an attribute of a dimension member.A member property is also an optional cube feature that is created in a dimensionto provide users with additional information about members. For this example,you can define the zip code or postal code as a member property. Define memberproperties at the Cube Designer - Member Property dialog box.

At the Define a Member Property dialog box, enter the member property name,level, column, and caption.

Note: The PROPERTY= statement is used here. �

6 Define aggregations. You can now define the aggregations for the cube.Aggregations are summaries of detailed data that are stored with a cube orreferred to by a cube. They can help contribute to faster query response. Definethe aggregations for the cube from the Cube Designer - Generated Aggregationsdialog box.

Select the levels for the aggregation with the Specify a generated user-definedaggregation dialog box.

Note: The AGGREGATION= statement is used here. �

7 Build the cube. You can now build the cube. You can choose to build the cube andregister it to the metadata repository, or you can register the cube to the metadatarepository. At the Cube Designer - Finish dialog box, review the settings for thecube, and then select one of the cube creations options.

Select whether to save the generated PROC OLAP code. At the Save PROCOLAP Code dialog box, enter the file location where you want to save the resultingcode.

Select the Finish button from the Cube Designer - Finish dialog box.

Note: When a SAS OLAP cube is created, a directory for that cube is also created.This directory is assigned the same name as the cube, but in uppercase letters. Forexample, when you save a cube in c:\olapcubes and name the cube Campaigns, thecube is saved in the directory c:\olapcubes\CAMPAIGNS. �

Saving a Cube’s PROC OLAP CodeIn SAS OLAP Cube Studio, you can elect to save the PROC OLAP code that is

generated when a cube is built. The code is saved to a text file that you specify. Theinformation saved in the file includes the following items:

� the SAS LIBNAME statement

� any FMTSEARCH statements

� any additional SAS code

� the PROC OLAP statement

� the METASVR statement

� all other PROC OLAP statements.

Page 35: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � PROC OLAP 27

You can access the Save PROC OLAP Code window by using one of the followingmethods:

1 On the navigation tree in SAS OLAP Cube Studio, right-click on a cube and selectSave PROC OLAP code.

2 In the Finish window in the Cube Designer wizard, right-click the Save PROCOLAP Code button.

The Save PROC OLAP Code window opens. In the Path field, enter the name andlocation of the file that you are saving to. An example is c:/temp/olapcode.txt.

PROC OLAPYou can build an OLAP cube with PROC OLAP and execute it in a SAS session.

Running PROC OLAP registers your cube and its sources in a metadata repository. Italso creates the files that make up the cube. These are the possible input types for anOLAP cube:

� a fact table (specified in the PROC OLAP statement DATA= option)

� dimension tables (specified in the DIMENSION statement DIMTBL= option)

� presummarized tables (specified in the AGGREGATION statement TABLE=option)

Note: You use the DATA= option when you use a detail table as the input. �

In this example, you are using data from a recent product marketing campaign. Youwant to establish measures and summaries of various aspects of your data such asgeographic location of potential customers, age of potential customers, and revenuesummaries. Our data is held in a table called olapsio.campnrml.

1 Define the metadata profile and general information. You use the PROC OLAPand METASVR statements here. The fact table is specified in the PROC OLAPstatement DATA= option. The METASRV statement is used to establish themetadata connection. It identifies the metadata repository in which existing cubemetadata information exists or in which metadata about a new cube should bestored. The statement is also used to provide a user’s identification and passwordfor the identified repository. Also the DRILLTHROUGH_TABLE= option is usedhere to indicate the drill-through table. Drill-through tables can be used by clientapplications to provide a view from processed data into the underlying data source.

proc olap cube=Campaign1path="c:\cubes"drillthrough_table=olapsio.campnrml;

metasvr host=localhostport=9999protocol=bridgeuserid=useridpw=pwrepository=Foundationolap_schema="OLAP Schema";

In OLAP Cube Studio, you define the above options in the following windows:

� Metadata Profile

� Connection Information

Page 36: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

28 PROC OLAP � Chapter 3

� Cube Wizard - General� Cube Wizard - Input.

2 Define dimensions, levels, and hierarchies. Now that your basic metadata serverand cube information has been entered, you can define the different dimensionsand their respective levels and hierarchies. For this example, you define thefollowing dimensions and levels:

� Campaigns� campaign type� campaign� subcampaign.

� Campaign Dates� campaign start year� campaign start month� campaign start day

� Geographic� division� region� client_id.

� Customer Age� age group1� age group2.

� Products� product group� product type.

You use the DIMENSION, HIERARCHY, and LEVEL statements here.

Note: For time-specific levels in a dimension, the LEVEL statement isrequired. Also, there can be only one time-specific dimension. �

dimension campaignshierarchies=(campaigns)caption="Campaigns"sort_order=ascformatted;

hierarchy campaignslevels=(campaign_type campaign sub_campaign);

dimension campaign_dateshierarchies=(campaign_dates)caption="Campaign launch dates"type=time;

hierarchy campaign_dateslevels=(campaign_start_year

campaign_start_monthcampaign_start)

;

Page 37: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � PROC OLAP 29

level campaign_start_yeartype=year;

level campaign_start_monthtype=months;

level campaign_starttype=days;

dimension geographichierarchies=(geographic)caption="Geographic";

hierarchy geographiclevels=(division region client_id);

dimension customer_agehierarchies=(customer_age)caption="Customer age";

hierarchy customer_agelevels=(age_group_1 age_group_2);

dimension productshierarchies=(products)caption="Products";

hierarchy productslevels=(product_group product_type);

In OLAP Cube Studio, the above options are defined in the following windows:

� Dimension Designer - General

� Dimension Designer - Levels

� Dimension Designer - Level Properties

� Dimension Designer - Define a Hierarchy.

3 Define measures. You can now define the measures for the cube, both stored andderived. A measure is an input column and a roll-up rule (statistic). Only certainmeasures are physically stored. Other measures are derived from the storedmeasures at run time. In this example, you want measures for revenue totals andthe number of customers you tracked during the campaigns.

You use the MEASURE statement here.

measure revenue_sumcolumn=revenuestat=sumformat=dollar15.2;

measure number_of_customers_sumcolumn=number_of_customersstat=sumformat=12.0;

Page 38: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

30 PROC OLAP � Chapter 3

In OLAP Cube Studio, the above options are defined in the following windows:� Cube Designer - Select Measures

� Cube Designer - Measure Details.

4 Define member properties. You can now define the member properties for anyneeded cube members. A member property is an attribute of a dimension member.A member property is also an optional cube feature that is created in a dimensionto provide users with additional information about members. For this example,you can define the zip code or postal code as a member property.

You use the PROPERTY statement here.

property zipcode-regioncolumn=post_codehierarchy=geographiclevel=region;

In OLAP Cube Studio, the above options are defined in the following windows:

� Cube Designer

� Member Property

� Define a Member Property.

5 Define aggregations. You can now define the aggregations for the cube.Aggregations are summaries of detailed data that is stored with a cube or referredby a cube. Their existence can reduce cube query time. If all aggregations are tobe generated at the time of cube creation (MOLAP cube), then you can selectspecific aggregations that must be created in addition to the NWAY, which is theonly aggregation that PROC OLAP makes by default.

You use the AGGREGATION statement here.

aggregation product_group product_typeage_group_1 age_group_2division region;

Note: The input type – presummarized tables – can also be specified in theAGGREGATION statement by using the TABLE= option. �

In OLAP Cube Studio, the above options are defined in the following windows:

� Cube Designer - Generate Aggregations

� Specify a generated user-defined aggregation.

6 Build the cube. You can now build the cube. Execute the PROC OLAP statementwithin the SAS System or in batch-mode. Here is the complete PROC OLAP code.

proc olap data=olapsio.campnrmlcube=Campaign1path="c:\cubes";

metasvr host=localhostport=9999protocol=bridgeuserid=useridpw=pwrepository=Foundationolap_schema="OLAP Schema";

Page 39: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � PROC OLAP 31

dimension campaignshierarchies=(campaigns)caption="Campaigns"sort_order=ascformatted;

hierarchy campaignslevels=(campaign_type campaign sub_campaign);

dimension campaign_dateshierarchies=(campaign_dates)caption="Campaign launch dates"type=time;

hierarchy campaign_dateslevels=(campaign_start_year

campaign_start_monthcampaign_start)

;level campaign_start_year

type=year;

level campaign_start_monthtype=months;

level campaign_starttype=days;

dimension geographichierarchies=(geographic)caption="Geographic";

hierarchy geographiclevels=(division region client_id);

dimension customer_agehierarchies=(customer_age)caption="Customer age";

hierarchy customer_agelevels=(age_group_1 age_group_2);

dimension productshierarchies=(products)caption="Products";

hierarchy productslevels=(product_group product_type);

measure revenue_sumcolumn=revenuestat=sumformat=dollar15.2;

measure number_of_customers_sumcolumn=number_of_customersstat=sum

Page 40: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

32 Building a Cube from a Summary Table � Chapter 3

format=12.0;

aggregation product_group product_typeage_group_1 age_group_2division region;

run;

Note: Any libraries must be specified prior to running the PROC OLAP code. �

Note: When a SAS OLAP cube is created, a directory for that cube is also created.This directory is assigned the same name as the cube, but in uppercase letters. Forexample, when you save a cube in c:\olapcubes and name the cube Campaigns, thecube is saved in the directory c:\olapcubes\CAMPAIGNS. �

Building a Cube from a Summary Table

In this example, you can build a cube with fully summarized data. A summary tableis a data source that contains a crossing of all dimensions for a cube. In this example,the data for the Campaign cube has been summarized into a table calledCAMPAIGN_SUMMARY. The table contains a column

� for each of the levels that you want

� for each of the stored measures, total revenue, and total number of customers

� for the member property and zip code region

The table contains only the NWAY. The data set was produced with the following SAScode:

proc summary data=olaplib.campaignnwaynoprint;

class campaign_type campaignsub_campaign campaign_start_yearcampaign_start_month campaign_startdivision region client_idage_group_1 age_group_2product_group product_type;

var revenue number_of_customers;

id post_code;

output out=olaplib.campaign_summarysum=totrev totcust;

run;

To create the cube by using SAS Cube Studio, follow these steps:

1 Start SAS Cube Studio and connect to the appropriate metadata server.

2 Define the campaign_summary table in the metadata by using the Source Designer.

3 To create a cube, select Cube Designer from the shortcut menu.

Page 41: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Summary Table 33

4 At the Cube Designer - General dialog box, enter the following information:� Cube Name� Description� Repository� OLAP Schema� Path in file system to store the cube� Input Type.

For input type, select Fully Summarized Table.5 At the Cube Designer - Input dialog box, select a data source or detail table for

your cube. For this example, select the campaign_summary table.

Note: If a detail table does not exist for your data, then select Define Tableand define the source that you will import your metadata from. �

Note: When you create a cube from a detail table or star schema, it is theequivalent of specifying the DATA= or FACT= options in the PROC OLAPstatement. When you select Fully Summarized Table, this is the same as notspecifying DATA= or FACT= and then specifying an AGGREGATION statementthat has all levels listed and has the TABLE= option specified with the tablename. Here is an example:

aggregation campaign campaign_type /table=olaplib.campaign_summaryname=’Default’;

6 On the Cube Designer - Drill-Through panel, select a drill-through table. Whenselecting a drill-through table (and you use a fully summarized table to load thecube) you should select the table that was used to create the summarized table. Inthis example, that is the campaign table. Select the radio button Selectdrill-through table from list, and then select the Campaign table.

7 Now that your basic metadata server and cube information has been entered, youcan define the different dimensions and their respective levels and hierarchies.This example cube has these dimensions:

� Campaigns� campaign type� campaign� subcampaign.

� Campaign Dates� campaign start year� campaign start month� campaign start day.

� Geographic� division� region� client_id.

� Customer Age� age group1� age group2.

Page 42: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

34 Building a Cube from a Summary Table � Chapter 3

� Products� product group� product type.

Define the dimensions for the cube. For each dimension, define the dimension, itslevels, and its hierarchies.

� At the Cube Designer - Dimensions dialog box, select the Add button. Thisopens the Dimension Designer - General dialog box. Enter the followinginformation:

� dimension name� caption� description� type of dimension (standard or time)� sort order.

� Select the necessary dimension levels at the Dimension Designer - Levelsdialog box.

� Define properties such as format, time type, and sort order at the DimensionDesigner - Level Properties dialog box.

� Define hierarchies for the levels at the Dimension Designer - Define aHierarchy dialog box.

� Repeat this process for each dimension.

Note: You use the DIMENSION, HIERARCHY, and LEVEL statements here.For time-specific levels in a dimension, the LEVEL statement is required. Also,there can only be one time-specific dimension and one GEO-specific dimension percube. �

8 You can now select the stored (base) measures for the cube in the Cube Designer -Select Stored Measures window. When loading from a detail table, the base andderived measures are generated from a single column in the detail table. Forexample, a detail table that has a column ACTUAL can have two measures –ACTUAL_SUM and ACTUAL_AVG – that are created from the column. However,with a fully summarized table, you must have one column for any base measurethat you want to include in the cube. The base statistics are SUM, N, NMISS,MIN, MAX, and USS. Measures that are created with these statistics must have asingle column in the summarized table. For this example, we have two base orstored measures: TOTREV and TOTCUST. Select the two columns in this window.

Note: This step is equivalent to using the AGGR_COLUMN option in theMEASURE statement. �

9 In the Cube Designer - Assign Stored Measures window, you can specify theStatistic and Analysis Group options for the stored statistics. Select SUM as thestatistic for both the TOTREV and TOTCUST measures. For Analysis group,specify REVENUE for TOTREV and NUMBER_OF_CUSTOMERS for TOTCUST.If the table contained two measures from the same analysis column, both of thebase measures would have the same analysis group specified. For example, ifcampaign_summary contained a column called REVN, which is the number ofnon-missing values for the REVENUE column, then we could have a base measureREVN with the statistic of count (N) and an analysis group of REVENUE.

Note: The analysis group is equivalent to the COLUMN|ANALYSIS option inthe MEASURE statement. �

10 In the Cube Designer – Select Derived Measures window, specify any measuresthat will be derived from the base or stored measures. Each derived measure is

Page 43: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Summary Table 35

based on a set of required stored measures. If the stored measures for an analysisgroup do not include all those required for a specific derived measure, then thatmeasure cannot be included in the cube. For example, TOTREV is the SUM of theREVENUE group. You cannot include AVGREV because you do not have the N orcount of the REVENUE group in the stored measures.

11 In the Cube Designer - Edit Measure Details window, specify captions, formats,and other information about the measures that are listed.

12 Define the member properties for any needed cube members. A member propertyis an attribute of a dimension member. A member property is also an optionalcube feature that is created in a dimension to provide users with additionalinformation about members. Define member properties at the Cube Designer -Member Property dialog box.

At the Define a Member Property dialog box, enter the member property name,level, column, and caption.

Note: You use the PROPERTY= statement here. �

13 Define the aggregations for the cube. Aggregations are summaries of detailed datathat is stored with a cube or referred by a cube. They can contribute to fasterquery response. If you have additional aggregation tables, select them in the CubeDesigner - Aggregation Tables window.

14 Define the stored aggregations in the Cube Designer - Stored Aggregationswindow. These are aggregations that are contained in the additional input tablesthat were selected in the Cube Designer - Aggregation Tables window.

Note: Defining aggregations in this panel is equivalent to using theAGGREGATION statement with the TABLE= option. �

15 In the Cube Designer - Generated Aggregations window, define additionalaggregations that will be generated when the cube is built.

16 Build the cube. In the Cube Designer - Finish window, you can select whether ornot you want the cube to be physically created after the metadata is saved. Whenyou select the Finish button, the metadata for the cube is always saved. If youselect Save the metadata and create the cube, the short form of the PROCOLAP code is generated along with the necessary LIBNAME statements andsubmitted to an application server. You can also select whether to save the PROCOLAP code that is generated. At the Save PROC OLAP Code dialog box, enter thefile location where you want to save the resulting code.

Note: When a SAS OLAP cube is created, a directory for that cube is also created.This directory is assigned the same name as the cube, but in uppercase letters. Forexample, when you save a cube in c:\olapcubes and name the cube Campaigns, thecube is saved in the directory c:\olapcubes\CAMPAIGNS. �

Here is the complete PROC OLAP code:

proc olap cube=Summary1drillthrough_table=olaplib.CAMPAIGN_SUMMARYpath="c:\cubes"description="Summary1";

metasvr host=localhostport=9999protocol=bridgeuserid=userid pw=pwrepository=Foundationolap_schema="OLAP Schema"

Page 44: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

36 Building a Cube from a Summary Table � Chapter 3

;dimension Campaigns

hierarchies=(Campaigns )caption=’Campaigns’sort_order=ascending;

hierarchy Campaignslevels=( Campaign_Type Campaign Sub_Campaign )caption=’Campaigns’default;

level Campaign_Typecaption=’Campaign Type’sort_order=ascending;

level Campaigncaption=’Campaign ID’sort_order=ascending;

level Sub_Campaigncaption=’Sub Campaign’sort_order=ascending;

dimensioon CampaignDateshierarchies=(CampaignDates )caption=’CampaignDates’type=timesort_order=ascending;

hierarchy CampaignDateslevels=( Campaign_Start_Year

Campaign_Start_Month Campaign_Start )caption=’CampaignDates1’default;

level Campaign_Start_Yeartype=yearcaption=’Campaign Start Year’sort_order=ascending;

level Campaign_Start_Monthtype=monthscaption=’Campaign Start Month’sort_order=ascending;

level Campaign_Starttype=dayscaption=’Campaign Start’sort_order=ascending;

dimension Geographichierarchies=( Geographic )caption=’Geographic’sort_order=ascending

Page 45: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Summary Table 37

;hierarchy Geographic

levels=( Division Region Client_ID )caption=’Geographic’default;

level Divisioncaption=’Division’sort_order=ascending;

level Regioncaption=’IFA Region’sort_order=ascending;

level Client_IDcaption=’Client id’sort_order=ascending;

dimension CustomerAgehierarchies=(CustomerAge )caption=’CustomerAge’sort_order=ascending;

hierarchy CustomerAgelevels=( Age_Group_1 Age_Group_2 )caption=’AgeGroup1’default;

level Age_Group_1caption=’Age Group 1’sort_order=ascending;

level Age_Group_2caption=’Age Group 2’sort_order=ascending;

dimension Productshierarchies=( Products )caption=’Products’sort_order=ascending;

hierarchy Productslevels=( Product_Group Product_Type )caption=’Products1’default;

level Product_Groupcaption=’Product Group’sort_order=ascending;

level Product_Typecaption=’Product Code’sort_order=ascending;

Page 46: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

38 Building a Cube from a Star Schema � Chapter 3

measure totrevSUMstat=sumanalysis=Revenueaggr_column=totrevcaption=’Sum of Revenue’format=BEST12.default;

measure totcustSUMstat=sumanalysis=Number_Of_Customersaggr_column=totcustcaption=’Sum of Number_Of_Customers’format=BEST12.;

run;

Building a Cube from a Star SchemaIn this example, you can build a cube from a star schema. A star schema is a data

source that contains tables in a database in which a single fact table is connected tomultiple dimension tables. In this example, an international retail company sells sportsand outdoor products.

To create the cube by using SAS Cube Studio, complete these steps:1 Start SAS OLAP Cube Studio and connect to the appropriate metadata server.2 To begin creating a cube, select Cube Designer from the shortcut menu.3 In the Cube Designer - General window, enter the following information:

� Cube Name� Description� Repository� OLAP Schema� Path in file system to store the cube� Input Type.

For input type, select Star Schema.4 In the Cube Designer - Input window, select a data source or detail table for your

cube. For this example select the ORDER_FACT table. If a detail table does not existfor your data, select Define Table, and then define the source that you willimport your metadata from.

Note: When you build the dimensions using PROC OLAP, and if you use a facttable from a star schema, use the FACT= option. Additionally, use FACT= optionto read a star schema, then use the DIMTBL= option to specify the dimensiontables. �

Note: If the cube is built from a star schema, then the keys that link thedimension table and the fact table are also defined by using the DIMKEY= andFACTKEY= options. See the “DIMENSION Statement” on page 86 for furtherinformation. �

5 In the Cube Designer - Drill-Through window, determine whether or not you willhave a drill-through table. In this example, you will not use a drill-through table,so you can select the option No table for Drill-Through.

Page 47: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Star Schema 39

6 In the Cube Designer - Dimension Tables window, select dimension tables that areassociated with the ORDER_FACT star schema that you specified as the datasource for the cube. For this example, select the following tables:

� CUSTOMER_DIM� GEOGRAPHY_DIM� ORGANIZATION_DIM_MOD_LEVELLED� TIME_DIM.

7 Now that your basic metadata server and cube information has been entered,define the different dimensions and their respective levels and hierarchies. Thisexample cube has these dimensions and levels:

� Time� Year_ID� Quarter� Month_Name� Week_Name� Date_ID.

For the Time dimension, the following star schema information is alsoincluded:

Table TIME_DIM

Key Date_ID

Fact Key Order_Date

� Customers� Customer_Name� Customer_Age� Customer_Gender� Customer_Group� Customer_Type.

For the Customers dimension, the following star schema information isalso included:

Table CUSTOMER_DIM

Key Customer_Id

Fact Key Customer_Id

� Geography� Continent_Name� Country� State� Region� Province

Page 48: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

40 Building a Cube from a Star Schema � Chapter 3

� County� City.

For the Geography dimension, the following star schema information isalso included:

Table GEOGRAPHY_DIM

Key Street_Id

Fact Key Street_Id

� Organization� Employee_Name� Job_Title� Salary� Gender� Company� Department� Org_Group� Section.

For the Organization dimension, the following star schema information isalso included:

Table ORGANIZATION_DIM

Key Employee_Id

Fact Key Employee_Id

Define the dimensions for the cube. For each dimension, you define the dimension,its levels, and its hierarchies.

� At the Cube Designer - Dimensions dialog box, select the Add button. Thisopens the Dimension Designer - General dialog box. Enter the followinginformation:

� dimension name� caption� description� type of dimension (standard or time)� sort order.

When you define the dimensions for a cube based on a star schema, you willneed to provide additional information about the dimensions in theDimension Designer - General window. On the Star Schema DimensionTables Definition panel, enter the following information:

� Table� Key� Fact Key� Data Set Options.

Page 49: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Star Schema 41

� Select the necessary dimension levels at the Dimension Designer - Levelsdialog box.

� Define properties such as format, time type, and sort order at the DimensionDesigner - Level Properties dialog box.

� Define hierarchies for the levels at the Dimension Designer - Define aHierarchy dialog box.

� Repeat this process for each dimension.

Note: You use the DIMENSION, HIERARCHY, and LEVEL statements here.For time-specific levels in a dimension, the LEVEL statement is required. Also,there can be only one time-specific dimension and one GEO-specific dimension percube. �

8 Specify the columns or measures for the cube. In the Cube Designer - SelectedMeasures window, select the following columns and associated Sum statistics:

� Total_Retail_Price /Sum� Quantity /Sum� CostPrice_Per_Unit /Sum� Discount /Sum.

9 Specify detail information for the measures. In the Cube Designer - MeasureDetails window, enter any necessary information for the different measures:

� Caption� Format� Unit� Description.

For the measure Total_Retail_Price, enter a format value of DOLLAR12.2. Forthe measure CostPrice_Per_Unit, enter a format value of DOLLAR10.2.

10 Specify member property information for the levels in the cube. In the CubeDesigner - Member Property window, select the Add button to create a newmember property. In the Define a Member Property window, enter the followinginformation about the member property:

� Name� Level� Column� Format� Caption Description� Selected Hierarchies.

In this example, the following member properties are created:

Property Name Level Column CaptionSelectedHierarchy

WeekDay_Number_US date weekday_no US WeekDayNumber

WeekDay_Number_EU date weekday_eu EU WeekDayNumber

Week_Number_EU week_name week_no EU Week Number YWD

Month_Number month_name month_no Month

Number

YMD

Page 50: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

42 Building a Cube from a Star Schema � Chapter 3

Property Name Level Column CaptionSelectedHierarchy

Month_Number month_name month_no Month

Number

YQMD

Holiday_US date Holiday_US US

Holidays

11 Specify the aggregations for the cube. Aggregations are summaries of detaileddata that is stored with a cube or referred by a cube. They can contribute to fasterquery response. In the Cube Designer - Generated Aggregations window, select theAdd button to specify aggregations and associated levels. Order the levels for theaggregations to follow the hierarchy drill path. The aggregations include

� RegionalCustomerUse� QuarterlyCustomerUse� YearlyCustomerUse� WorldwideStaff� WorldwideSalaries.

Note: When you create cubes in SAS OLAP Cube Studio, a defaultaggregation, which is the NWAY aggregation, is automatically created and listedin the Cube Designer - Generated Aggregations window. �

12 Build the cube. In the Cube Designer - Finish window, select whether or not youwant the cube to be physically created after the metadata is saved. When you clickFinish, the metadata for the cube is always saved. If you select Save themetadata and create the cube, the short form of the PROC OLAP code isgenerated along with the necessary LIBNAME statements and submitted to anapplication server. You can also select whether to save the PROC OLAP code thatis generated. At the Save PROC OLAP Code dialog box, enter the file locationwhere you want to save the resulting code.

Note: When a SAS OLAP cube is created, a directory for that cube is also created.This directory is assigned the same name as the cube, but in uppercase letters. Forexample, when you save a cube in c:\olapcubes and name the cube Campaigns, thecube is saved in the directory c:\olapcubes\CAMPAIGNS. �

Here is the complete PROC OLAP code:

proc olap cube=Starpath="c:\cubes"fact=olapsio.ordfact;

metasvr host=localhostport=9999protocol=bridgeuserid=useridpw=pwrepository=Foundationolap_schema="OLAP Schema";

dimension Timehierarchies=(YWD YMD YQMD)type=time

Page 51: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Star Schema 43

dimtbl=olapsio.timedimdimkey=date_IDfactkey=order_date;

hierarchy YWDcaption="Year-Week-Day"levels=(Year_ID Week_Name Date_ID;

hierarchy YMDcaption="Year-Month-Day"levels=(Year_ID Month_Name Date_ID);

hierarchy YQMDcaption="Year-Quarter-Month-Day"levels=(Year_ID Quarter Month_name Date_ID);

level year_IDtype=year;

level quartertype=quarters;

level month_nametype=months;

level week_nametype=weeks;

level date_IDtype=days;

property WeekDay_Number_UScaption="US WeekDay Number"column=weekday_nolevel=date;

property WeekDay_Number_EUcaption="EU WeekDay Number"column=weekday_eulevel=date;

property Week_Number_EUcaption="EU Week Number"column=week_nohierarchy=YWDlevel=week_name;

property Month_Numbercaption="Month Number"column=month_nohierarchy=YMDlevel=month_name;

property Month_Number

Page 52: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

44 Building a Cube from a Star Schema � Chapter 3

caption="Month Number"column=month_nohierarchy=YQMDlevel=month_name;

property Holidays_UScaption="US Holidays"column=Holiday_uslevel=date;

dimension Customershierarchies=(PersonalData CompanyUsage)dimtbl=olapsio.custdimdimkey=customer_idfactkey=customer_id;

hierarchy PersonalDatalevels=(Customer_Name Customer_Age Customer_Gender);

hierarchy CompanyUsageempty_char=_missing_levels=(Customer_Group Customer_Type);

dimension Geographyhierarchies=(Geography)dimtbl=olapsio.geogdimdimkey=street_idfactkey=street_id;

hierarchy Geographyempty_char=_missing_levels=(Continent_Name Country

State Region ProvinceCounty City)

;dimension Organization

hierarchies=(PersonalStats Organization)dimtbl=olapsio.orgdimdimkey=employee_idfactkey=employee_id;

hierarchy PersonalStatslevels=(Employee_name Job_Title Salary Gender);

hierarchy Organizationempty_char=_missing_levels=(Company Department

Org_Group Section Job_Title);

measure DiscountSumstat=sumcolumn=Discount;

measure CostPrice_Per_UnitSum

Page 53: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Cube Building Examples � Building a Cube from a Star Schema 45

stat=sumcolumn=CostPrice_Per_Unitformat=DOLLAR10.2;

measure QuantitySumcolumn=Quantitycaption=’Sum of Quantity’;

measure Total_Retail_PriceSumstat=sumcolumn=Total_Retail_Priceformat=DOLLAR12.2;

aggregation Continent_Name Country StateRegion Customer_Group Customer_Type/ name=’RegionalCustomerUse’;

aggregation Year Quarter Customer_Group Customer_Type/ name=’QuarterlyCustomerUse’;

aggregation Year Customer_Group Customer_Type/ name=’YearlyCustomerUse’;

aggregation Continent_Name CountryState Region Province CompanyDepartment Org_Group Section/ name=’WorldwideStaff’;

aggregation Continent_Name Country StateRegion Province Employee_NameJob_Title Salary/ name=’WorldwideSalaries’;

run;

Page 54: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

46

Page 55: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

47

C H A P T E R

4Modifying and Updating Cubes

Updating a Cube 48Refreshing Cube Metadata 48

MDX DDL REFRESH Statement 49

Tuning Cube Aggregations 49

Using the Manual Tuning Function 50

Using the Advanced Aggregation Tuning Plug-In 51Using PROC OLAP to Tune Aggregations 51

Monitoring OLAP Server Performance 52

Specifying Tuning and Performance Options in Cube Aggregations 52

Setting Options on the Cube Designer Wizard 52

Global Tab 52

Aggregation Tab 53Setting Options on the Manual Tuning Function or the Advanced Aggregation Tuning Plug-in 53

Setting Options with PROC OLAP 54

Multiple Language Support and Dimension Table Translations 54

SAS OLAP Cube Studio and Dimension Table Translations 55

PROC OLAP and the USER_DEFINED_TRANSLATIONS Statement 55SAS Servers and Character Encoding 55

Adding SAS System Options to a Cube 55

Synchronizing a Cube 56

Exporting and Importing Cubes 56

Exporting Cubes 57Importing Cubes 57

Managing Cube Data 58

Cube and Aggregation Path Settings 58

User Privilege Considerations 58

Repository Considerations 59

Creating Connection Points 59File Naming Considerations 59

Multi-Language Cubes 59

Manually Copying and Moving SAS OLAP Cubes 60

Manually Copying or Moving SAS OLAP Cube Files 60

Manually Copying MOLAP Files 60Manually Copying ROLAP Files 61

Changing a Cube’s Data and Index Paths 62

Accessing OLAP Cubes from SAS: SQL Pass-Through Facility for OLAP 62

Conversion Issues 62

VALIDVARNAME 63Data Types 63

PROC SQL Syntax 63

SQL Pass-Through Example 64

Page 56: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

48 Updating a Cube � Chapter 4

Specifying GIS Map Information for a Dimension 65Specifying Calculated Members 65

Using the Calculated Members Plug-in 66

Selecting Calculation Types 66

Simple Calculations 66

Time Analysis Calculations 67Custom Calculations 67

Updating a CubeA cube can be updated after its initial creation in order to optimize cube performance

and to add or remove aggregations. Any cube update changes elements of both thephysical cube and its metadata registration. You can update a cube in either SAS OLAPCube Studio or with PROC OLAP code.

� To update an existing cube in SAS OLAP Cube Studio, select the cube that youwant to modify, right-click, and select the Edit Cube Structure option. You canalso access this function from the Actions menu. This opens the Cube DesignerWizard. Make any necessary changes to the cube. At the Cube Designer - Finishdialog box, review the settings for the cube and select one of the cube creationsoptions. SAS OLAP Cube Studio deletes the cube, and then rebuilds it with thechanges that you entered.

� To update a cube by using PROC OLAP code, modify the code as needed and savethe updated code. Use the DELETE option, the DELETE_PHYSICAL option, orboth from the PROC OLAP statement to delete the cube. Resubmit the modifiedcode to rebuild the cube. See the DELETE and DELETE_PHYSICAL options forthe “PROC OLAP Statement” on page 79 for further information. Here are threepossible usage scenarios:

If you are changing captions and descriptions or the dimensions or measures,You must use DELETE to remove the physical cube and the metadataregistration. This is because you are submitting the full PROC OLAP syntaxwith changes.

If the input table has new data and you only want to refresh the cube,You should use DELETE_PHYSICAL to delete only the physical cube. Youcan then submit the shorter form of the PROC OLAP syntax with only thePROC OLAP statement and METASVR statement.

If you are optimizing cube performance by adding or deleting aggregations,You should not use the DELETE or DELETE_PHYSICAL options. This isbecause you are updating the cube in its current state.

Refreshing Cube MetadataYou can refresh the metadata for calculated members and named sets that are

associated with a cube by using the Refresh Cubes function, which is available from theSAS OLAP Cube Studio toolbar. The refresh cubes function reads the information aboutcalculated members and named sets that is stored on the metadata server. The refreshcubes function then updates the OLAP server metadata for the cube. You must beconnected to a server and have administrative permissions in order to select theRefresh Cubes function.

With the Refresh Cubes function, you can select from a list of one or more cubes torefresh. You can also select a check box that selects all cubes. The cubes listed are

Page 57: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Tuning Cube Aggregations 49

those cubes that are assigned to the current OLAP schema and that physically exist.When you have selected the cubes that you want to refresh, select OK. The refreshcommand is then sent to all cubes that were selected.

After the selected cubes have been refreshed, you are prompted to check otherservers that the current OLAP schema is associated with.

MDX DDL REFRESH StatementThe REFRESH statement can be sent manually. You can send the REFRESH

statement for each additional server that the schema is associated with.

REFRESH CUBE (cubename | "_ALL_" )

Where cubename specifies a single cube to refresh for the current server connection. Or_ALL_ specifies that all cubes are refreshed for the current server connection. Here aresome examples.

This example uses the REFRESH statement to refresh the metadata associated witha cube named OrionStar.

refresh cube [OrionStar]

This example uses the REFRESH statement to refresh the metadata for all cubesmanaged by the connected server.

refresh cube _ALL_

You can use the OLAP MDX SQL Pass-Through facility to send the DLL REFRESHstatement to a server. Here is an example.

proc sql noerrorstop;connect to olap (&olapcon);execute(

refresh cube [OrionStar]) by olap;

proc sql noerrorstop;connect to olap (&olapcon);execute(

refresh cube _ALL_) by olap;

Tuning Cube Aggregations

When a cube is created, aggregations can be specified by the user. Aggregations areusually created to improve query performance. After a cube is created and queries arerun against the cube, users might discover that certain aggregations are not being used,and adjustments and changes to the aggregations are needed. You might want tochange the levels in an aggregation, add another aggregation, or entirely remove anaggregation.

Tuning aggregations is important for improving query response times. After youhave created and executed reports for your cubes, you can determine what are the mostcommon queries generated or what are the least common queries generated. These canthen be compared to the aggregations available. It is recommended to add those

Page 58: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

50 Using the Manual Tuning Function � Chapter 4

aggregations that are commonly used (those that may only need a modification of anexisting aggregation) and delete those that are not necessary.

There are three possible options to modify the aggregations for a cube:

� Manual Tuning (within SAS OLAP Cube Studio)

� Advanced Aggregation Tuning plug-in (within SAS OLAP Cube Studio)

� PROC OLAP

Using the Manual Tuning FunctionThe Manual Tuning function in SAS OLAP Cube Studio allows you to adjust and

improve an existing cube by adding, dropping, or modifying aggregations. ManualTuning requires an active IOM server connection. When you select Manual Tuning youare prompted for a SAS IOM Server. If no valid server is available, the Manual Tuningwindow will not open. In addition, only MOLAP cubes that have an existing physicalcube, along with a SAS Metadata Repository registration, can use the Manual Tuningfunction.

You can access the Manual Tuning function within SAS OLAP Cube Studio byselecting an existing cube and right-clicking to display the menu that lists the ManualTuning function. Or, you can also access it from the main OLAP Cube Studio menuunder the Actions menu.

The Manual Tuning window lists the defined aggregations for the selected cube.When you finish making selections and select OK, the PROC OLAP statements aresubmitted to the IOM application server and the cube data is updated. With theManual Tuning Window you can

� Add an aggregation - select Add to create a new aggregation. Enter theaggregation name and select the levels for the aggregation. Select Apply to saveand validate the aggregation. If the aggregation is a duplicate or it is not inhierarchy order, you will receive an error message.

� Delete an aggregation - select an aggregation from the list box, and then selectDelete.

� Modify an aggregation - select an aggregation from the list box, and then selectModify. The bottom panel populates with the aggregation values, and you canselect or deselect the levels. When you finish modifying the aggregation levels,select Apply to save the changes. Select Apply to validate the aggregation. If theaggregation is not in hierarchy order, you will receive an error message.

Here are some guidelines for using Manual Tuning:

� Manual Tuning is available only for MOLAP cubes.

� Levels that are specified for an aggregation must follow at least one existinghierarchy.

� When you modify aggregations, you cannot modify the aggregation name.

� If the cube has an NWAY aggregation, it will display, but it cannot be modified ordeleted.

� You cannot add duplicate aggregations in the Manual Tuning window. A duplicateaggregation has the same name as another aggregation or the same list of levelsas another aggregation. When you add an aggregation to a cube and select Apply.Validation will occur to ensure that the aggregation to add is not a duplicate andthat its levels follow a hierarchy order.

Note: If a cube has presummarized aggregations, the Modify function will not beactive if a presummarized aggregation is selected. �

Page 59: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Using PROC OLAP to Tune Aggregations 51

Using the Advanced Aggregation Tuning Plug-InThe Advanced Aggregation Tuning function provides automatic generation of cube

aggregations. It is additive in nature. Aggregations created with the AdvancedAggregation Tuning function are added to the list of existing aggregations that mayalready be defined for the cube. It is available as a plug-in component for SAS OLAPCube Studio.

Within the Advanced Aggregation Tuning plug-in, a generated list of aggregations iscreated. This list is then further processed to remove any aggregations that alreadyexist in the cube. The Advanced Aggregation Tuning function includes two aggregationgeneration methods, Cross-Dimensional and ARM Analysis.

Cross-Dimensional upto number oflevels:

Cross-Dimensional tuning is recommended when a cube is firstcreated and no ARM log exists yet. It constructs aggregations usingthe different combinations of levels across all hierarchies. You canuse the spin selector to change the maximum number of levels touse in the hierarchies, starting at the top level of the hierarchy andgoing down in the hierarchy drillpath order.

Arm Analysis ARM Analysis is recommended for optimal cube tuning. It is thepreferred method to generate aggregations for cube tuning. ArmAnalysis constructs aggregations using the ARM log (created whenthe cube is queried with ARM logging turned on).

ARM analysis requires that ARM logging be turned on and thatan arm log already exist and be available in order for queries to beperformed against the cube. The ARM log is used to deduce whichaggregations to generate that will most likely have positive impacton query performance. It is only as effective as the amount of ARMdata provided and whether the ARM log data truly reflects the cubequery patterns going to be done. You can type in the name of log fileor use the Browse button to select a file on a local machine. If youwant to select a file that is on a remote machine, you can map thedrive for remote access on your local machine. Generatedaggregations will be listed in descending order by Count (thenumber of times that a query needed the aggregation). The Countand Elapsed Time (wall time) are displayed in the table with eachgenerated aggregation.

With either aggregation generation method, you select the aggregations to add to thecube from a generated list.

Using PROC OLAP to Tune AggregationsTo modify an aggregation through PROC OLAP, use the DROP_AGGREGATION

statement to delete the aggregation, and then use the AGGREGATION statement todefine the new aggregation.

� DROP_AGGREGATION level-name1 < level-name2 ...level-nameN > /NAME=‘aggregation-name’ ;

� AGGREGATION level-name1 / < NAME=‘aggregation-name’ > ;

For more information about the DROP_AGGREGATION and AGGREGATIONstatements, see “The OLAP Procedure” on page 78.

Page 60: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

52 Monitoring OLAP Server Performance � Chapter 4

Monitoring OLAP Server PerformanceSAS OLAP Server performance is monitored and logged with the Application

Response Measurement (ARM) interface. The ARM interface provides built-in loggingcapabilities and generates log records that indicate query content and query start andcompletion times. From this data, information regarding aggregation usage, individualquery response times, or throughput can be determined. Traditionally, ARM enablessystem administrators to monitor application executions, run times, performance, andcompletion. SAS OLAP Server uses ARM to monitor

� application behavior� user behavior and usage� server loads� cube optimization (query response time)� cube metrics—counts of connections and queries.

For more information, see “Monitoring Performance Using Application ResponseMeasurement (ARM)” in SAS Language Reference: Concepts.

Specifying Tuning and Performance Options in Cube AggregationsWhen you build cubes, you can set various options that improve and optimize cube

creation and query performance. These options can be set for all aggregations in a cubeor for a specific aggregation. Additionally, these options can be set by using the PROCOLAP options or in SAS OLAP Cube Studio. These options are stored with the cubemetadata in the SAS Metadata Repository.

Setting Options on the Cube Designer WizardIn the Cube Designer - Generated Aggregations window, an Advanced button is

provided for access to tuning options. Select the Advanced button to open thePerformance Options window. There are two tabs for setting tuning options, the Globaltab and Aggregation tab.

Global TabThe global performance options are applied to all aggregations for the cube. These

performance options include the� amount of memory (in megabytes) that is available for aggregation creation� maximum number of threads that are used to create an aggregation index� number of aggregations to create in parallel� partition size (in megabytes) of aggregation table partitions� number of observations (in kilobytes) to include in the index component file

segment� location of index component files� location of partitions in which to place aggregation table data� aggregation tables that are stored in compressed format.

For specific information about these functions, see the Performance Options - Global tabin SAS OLAP Cube Studio Help.

Page 61: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Setting Options on the Manual Tuning Function or the Advanced Aggregation Tuning Plug-in 53

Aggregation TabThe aggregation-specific performance options are applied to an individual

aggregation for the cube and override the global option settings for that aggregation.You can define and modify performance options for an aggregation or delete options foran aggregation. The aggregation-specific performance options include the

� partition size (in megabytes) of aggregation table partitions� number of observations (in kilobytes) to include in the index component file� location of index component files� location of partitions in which to place aggregation table data� aggregation tables stored in compressed format� aggregations created with indexes

For specific information about these functions, see the Performance Options - DefineAggregation Options dialog box in SAS OLAP Cube Studio Help.

Setting Options on the Manual Tuning Function or the AdvancedAggregation Tuning Plug-in

When you add aggregations to a cube, using either the Manual Tuning or theAdvanced Aggregation Tuning function, it is sometimes necessary to change the originalsettings for certain performance options to more optimal values. It is also possible tochange the values without having to rebuild the cube.

The Options window enables you to specify certain performance options on the PROCOLAP statement when adding or modifying aggregations for a cube. On this windowyou can view the current values and change the values when needed. If you change oneof the performance option values, the option will be added onto the PROC OLAPstatement when the tuning code is submitted. The procedure will then add the newvalues into the metadata. When you first open the window, the current set values of theoptions will be listed. The following performance tuning options are available:

Number ofaggregations tocreate inparallel

the number of concurrent aggregations that will be built. This valuemust be greater than or equal to zero. This is the equivalent of thePROC OLAP CONCURRENT option.

Maximumnumber ofthreads to use

the number of threads to use when creating aggregations. Thisvalue must be greater than or equal to zero and less than 65536.This is the equivalent of the PROC OLAP MAXTHREADS option.

Memory to usecreatingaggregations

the amount of memory to use when creating aggregations. Thisvalue must be greater than or equal to 32 and less than 10239. Thisis the equivalent of the PROC OLAP INDEXSORTSIZE option.

Note: If no aggregation changes are made or if the only changes made are deletionsof aggregations, changes made to the tuning options will not be saved. �

Page 62: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

54 Setting Options with PROC OLAP � Chapter 4

Setting Options with PROC OLAPYou can set options for all aggregations in a cube or for a specific aggregation. To set

options for all aggregations, set the options in the PROC OLAP statement. To setoptions for a single aggregation, set the options in the PROC OLAP - Aggregationstatement. The options include

INDEXSORTSIZE=nspecifies the amount of memory in megabytes that is available when aggregationsare created. The default is the system’s available memory.

MAXTHREADS=nspecifies the maximum number of threads that are used to asynchronously createthe aggregation indexes.

CONCURRENT=nspecifies the maximum number of aggregations to create in parallel.

WORKPATH=pathnamespecifies one or more locations for temporary work files.

DATAPATH=(’pathname1’ ...’pathnameN’)specifies the location of one or more partitions in which to place aggregation tabledata.

INDEXPATH=(’pathname1’ ...’pathnameN’)specifies the locations of the index component files that correspond to eachaggregation table partition as specified by the DATAPATH= option.

COMPRESS | NOCOMPRESSspecifies whether or not to store the aggregation tables in a compressed format ondisk.

INDEX | NOINDEXspecifies whether or not to create the aggregations with indexes.

PARTSIZE=partition-sizespecifies the partition size in megabytes of the aggregation table partitions andtheir corresponding index components.

SEGSIZE=rows-per-segmentspecifies the number of observations (table rows) in kilobytes to include in theindex component file segment.

Note: INDEXSORTSIZE=, MAXTHREADS=, and CONCURRENT= are onlyavailable in the PROC OLAP statement. �

For more information about these options, see “PROC OLAP Statement” on page 79 and“AGGREGATION Statement” on page 99.

Multiple Language Support and Dimension Table Translations

OLAP cube data is often generated in one language but needed in other languages.For example, a company’s OLAP cube data might be stored in English, but users whospeak Spanish and Turkish need access to it. So, the member values as well as thecaptions that are assigned to dimensions, hierarchies, levels, etc., need to be translated.Multiple language support is available only for cubes that are loaded from star schemas.

Page 63: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Adding SAS System Options to a Cube 55

It is used to read your alternate locale data sets and create locale-specific metadata foruse at query time. Query results are returned in the language of the requested locale.

You can specify language support when building a cube either in the Cube DesignerWizard or with PROC OLAP code. There are 56 possible language locales, and Englishis the default language.

SAS OLAP Cube Studio and Dimension Table TranslationsIn the Cube Designer - General window, select the Advanced button. If you selected

Star Schema as the input type in the Cube Designer - General window, you will see theDimension Table Translations tab. From the Available Languages/Locales list box,select the needed languages for the translation tables. The first language in theSelected Languages/Locales list box is the default language.

PROC OLAP and the USER_DEFINED_TRANSLATIONS StatementThe USER_DEFINED_TRANSLATIONS statement is used in conjunction with the

DIMENSION statement options DIMTABLEMEMPREF= and DIMTABLELIBREF=.For more information, see the “DIMENSION Statement” on page 86.

SAS Servers and Character EncodingIf your server metadata contains characters other than those typically found in

English, then you must be careful to start your server with an encoding= or locale=system option that accommodates those characters. For example, a SAS server startedwith the default US English locale cannot read metadata that contains Japanesecharacters. SAS will fail to start and log a message indicating a transcoding failure.

In general, different SAS jobs or servers can run different encodings (such as ASCII/EBCDIC or various Asian DBCS encodings) as long as the encoding that is used by theparticular job or server can represent all the characters of the data being processed. Inthe context of server start up, this requires that you review the characters used in themetadata describing your server (as indicated by the server= objectserverparm) toensure that SAS runs under an encoding that supports those characters.

Adding SAS System Options to a CubeWhen you build an OLAP cube, it is often necessary to include additional SAS code

that must run prior to the creation of the cube. This includes the creation ofuser-written formats, PROC statements, and format search paths for the formats thatare used on input tables. The Advanced Cube Options window that is accessed from theCube Designer - General window provides the two entry tabs, Submit SAS Code andFormat Search Path. Both tabs provide entry fields for SAS code. You can enter anytext in the fields. There is no validation of the text that is entered. However, errormessages are sent to the SAS log.

The text is saved to the cube metadata in the SAS Metadata Repository and is usedevery time the cube is created. You can edit or remove the text after it is initiallyentered. Highlight the text and make any needed changes, or use the Delete key toremove the text. Select OK to save your changes.

Submit SASCode

You can use this field to enter a PROC statement or any SAS codethat you want to submit before the cube is created. SAS code issubmitted before any format search path.

Page 64: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

56 Synchronizing a Cube � Chapter 4

Format SearchPath

You can use this field to enter names of catalogs or libraries for theformat search path. The catalogs and libraries must be separated bya blank and will be searched in the order in which they are listed.You use the SAS system option FMTSEARCH= here.

Note: For more information about SAS formats, see “Formats” inSAS Language Reference: Dictionary. �

Note: When you build a cube with SAS OLAP Cube Studio, the format search pathis saved with the cube metadata in the SAS Metadata Repository and used every timethe cube is recreated. However, if you submit PROC OLAP code through a SAS session,outside of SAS OLAP Cube Studio, the format search path is ignored. PROC OLAP willnot read the information from the SAS Metadata Repository or write the information tothe SAS Metadata Repository. �

Synchronizing a CubeThe SAS OLAP Cube Studio — Synchronize Levels function enables you to

synchronize a cube when the input table for an existing cube has encountered a columnname change. This function finds the name differences between the cube and its inputtable and changes the hierarchy level names to match the input table column names.You can access the Synchronize Levels function in SAS OLAP Cube Studio from theActions menu or by right-clicking a cube. If you are not connected to a workspaceserver when you select a cube, you will be prompted to select a workspace server.

Sometimes it is necessary to change a variable name in the input table that a cube isbased on. However, this can result in the level names for an existing cube to be out ofdate. For example, if an input table for a cube has a hierarchy of Year, Quarter, Month,Day, and the column name “Month” is changed to “Mois” (the French spelling of Month),then the cube hierarchy level name "Month" will be out of sync with the input table’scolumn name "Mois." The Synchronize Levels function enables you to update thehierarchy with the new month name.

The Synchronize Levels function obtains the cube metadata from the ObjectMetadata Repository and compares the names between the input table and the cubehierarchy. If a discrepancy is found, a new cube file and definition are created with thenew level name. The level name of the existing cube is then updated to reflect the newcolumn name.

The Synchronize Levels function is available for a cube if the cube physically existsand you have writemetadata permissions for that cube. In addition, if you are in achange-managed environment, you must be in the project repository.

Note: If the default Level caption is used (the Level name), then the Level caption isalso updated. You need to update any existing reports or MDX queries that use the oldlevel name. You also need to update any permission conditions or calculated membersthat reference the old level name. You cannot update an unregistered cube. �

Exporting and Importing CubesWhen administering SAS OLAP cubes it is sometimes necessary to copy or move the

cubes. Some possible activities include the following:� copying cubes from one environment to another� archiving cubes for backup purposes� moving cubes from a development system into production

Page 65: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Importing Cubes 57

SAS OLAP Server cubes are collections of files that are typically large and have aphysical component (the files that make up the cube), and a metadata component (thecube’s registration in a metadata repository). Both the cube files and registration needto be kept in sync when you copy or move cubes. The SAS OLAP Cube Studio ExportCube and Import Cube functions enable you to copy cube metadata from a sourcerepository to a target repository, and if needed, to another server.

The Export Cube function extracts a cube’s metadata from the source repository andsaves it in a file that is specified by the user. All information about a cube, including itsdimensions, hierarchies, levels, measures, notes, properties, calculated measures,aggregations, and security settings, will be extracted. The Import Cube function thenenables you to save the cube metadata to another metadata repository on anothermetadata server.

Exporting CubesThe Export Cube function extracts a cube’s metadata from the current repository and

saves it in a file that is specified by the user. All information about a cube, including itsdimensions, hierarchies, levels, measures, notes, properties, calculated measures,aggregations, and security settings, will be extracted. You can launch the Export Cubefunction by right-clicking a cube object in the Cube Studio Navigation Tree andselecting Export Cube. This opens the Export Cube to File window.

When exporting cube metadata, you must provide a name for the file that you areexporting the metadata to. If you have not previously created an export file, then thedefault filename displayed will be user-default-directory\cubename.xml.

If you have previously created an export file, then the directory of the filenamedisplayed will be the last directory that you exported cube metadata to. The filenamewill be composed of last-export-directory-used\cubename.xml. The name of the cubethat you selected will be entered along with a .xml extension.

Note: The exported file should not be edited or changed by the user. �

Importing CubesThe Import Cube function imports a cube’s metadata from a previously exported file

and enables you to save the cube metadata to another metadata repository on anothermetadata server. All information about a cube, including its dimensions, hierarchies,levels, measures, notes, properties, calculated measures, aggregations, and securitysettings, will be imported.

You can launch the Import Cube function by clicking Import Cube on the SAS OLAPCube Studio Shortcut Bar. You can also select it from the SAS OLAP Cube Studio Toolsmenu. This opens the Import Cube from File window. In the Import file field, youcan enter the name and location of the file that you will import. You can also click theBrowse button to select a file. If you have not selected an import file before, then theselected file that is shown by default is user-current-directory\extractedcube.xml. If youhave selected an import file before, then the last selected file is displayed by default.

In addition to these considerations, all connection points for the cube must exist inthe target repository with the same names in order for the cube to import correctly. Thefollowing metadata connection points must exist:

� the OLAP schema for the cube

� all of the tables (input, dimension, drill-through, and aggregation) and columnsthat are associated with the cube. The table in the target repository must have thesame Library name as the table that is located where the cube was exported from

Page 66: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

58 User Privilege Considerations � Chapter 4

� any UniqueKey, ForeignKey, and KeyAssociation objects required by star schemas

� the identities, groups, and permissions for the security settings

Note: If a cube with the same name as the import cube already exists in the OLAPschema, an error message appears. �

Managing Cube Data

After selecting a cube to import, you need to indicate whether you want to create newcube data, refer to the existing cube data, or manually move the cube. On the CubeImport Wizard — Manage Cube Data window, select one of the following options:

Yes, the cubedata will becreated afterimport

You will create new cube data after the cube metadata is imported.This is the default setting.

No, the cubedata will notbe createdafter import

New cube data will not be created. The cube will refer to theexisting cube data from the cube that you selected or you willmanually move the cube data to the new file locations.

Note: If the cube must be created after the import, the option No, the cube datawill not be created after import will be disabled. This will happen if theimported cube metadata indicates that the cube has not been created. It will also bedisabled if you have changed a path that is associated with an aggregation. This isbecause cube data cannot be moved if an aggregation path changes. �

Cube and Aggregation Path Settings

After selecting a cube to import, you can verify and edit path settings for both thecube and the cube’s aggregations. On the Cube Import Wizard— Substitute Cube Pathswindow you can view and edit settings for both Global paths and Aggregation paths.

Global Paths The path values for the imported cube are displayed in the leftcolumn, under the heading Exported Value. You can choose tomodify the Import Value.

AggregationPaths

The aggregation path values of the imported cube are displayed foreach aggregation, including the default aggregation. You can chooseto modify the Import Value.

When you have finished editing the cube data and path settings you can finalize theimport process on the Cube Import Wizard — Wizard Finish window. In this window,you can review the filename and storage path of the file that you are importing. Youcan also review the cube name and the OLAP schema for the cube. Click Finish toimport the file. The cube metadata will be imported into your current repository.

User Privilege ConsiderationsIt is recommended that the person performing the cube export or import be the

AdminUser or someone who has full access to the cube. This is because other usersmight have restrictions on parts of the cube that could result in a partial cube beingexported and imported.

Page 67: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Multi-Language Cubes 59

Repository ConsiderationsIt is also recommended that all information about a cube be stored in the same

repository and that you export and import a cube into the same type of repository. Forexample: If you export from a foundation repository, then you should import into afoundation repository. Or if you export from a custom repository, then you import intoanother custom repository. An export from one type of repository to a different type ofrepository (for example, foundation to custom) is not supported at this time. Also,export from and import into project repositories is not supported.

Creating Connection PointsCertain metadata must exist prior to importing a cube. All metadata connection

points for the cube must exist in the target repository with the same names. If ametadata connection object is not found in the repository, then the import will fail. Thefollowing metadata connection points must exist:

� the OLAP schema for the cube - OLAP schemas can be created using the OLAPSchema wizard in SAS OLAP Cube Studio.

� the tables (input, dimension, drill through and aggregation) and columns that areassociated with the cube - the table in the target repository must have the sameLibrary name as the table that is located where the cube was exported from. Usethe Source Designer in SAS OLAP Cube Studio, SAS Management Console, orSAS Data Integration Studio to load the table and column definitions.

� any UniqueKey, ForeignKey, and KeyAssociation objects required by star schema -keys can be created using the Property Sheet for a table in SAS ManagementConsole or SAS Data Integration Studio.

� the identities, groups, and permissions for the security settings - security settingscan be created using the Authorization Manager in SAS Management Console.

Note: Foreign key associations must exist for your fact tables. However, if theforeign key association does not exist on the fact table for your star schema cube, theimport will succeed but the error will be detected when you build the cube or edit thecube metadata using the Cube Designer. �

File Naming ConsiderationsWhen exporting cube metadata, you must provide a name for the file that you are

exporting the metadata to. If you have not previously created an export file, then thefile will be saved in the user-default-directory. The filename will be composed ofuser-default-directory\cubename.xml.

If you have previously created an export file, then the file will be saved in the lastdirectory that you exported cube metadata to. The filename will be composed oflast-export-directory-used\cubename.xml.

When importing cube metadata, if you have not selected an import file before, thenthe selected file shown by default is user-default-directory\extractedcube.xml. If youhave selected an import file before, then the last selected file is displayed by default.

Note: An existing OLAP cube cannot be renamed. �

Multi-Language CubesYou can export and import multi-language cubes. However, only the dimension tables

for the server language (the first language in the UDT statement) are verified for

Page 68: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

60 Manually Copying and Moving SAS OLAP Cubes � Chapter 4

registration. You must ensure that all the tables are present. If one of the tables ismissing when the cube is imported, the import will still be successful, but the cubemight not rebuild correctly.

Manually Copying and Moving SAS OLAP CubesAfter copying a cube’s metadata using the Export and Import functions, you can

choose to manually copy the cube files from one location to another instead of reusingthe existing cube files or rebuilding the entire cube. Copying the physical components ofa cube involves copying some or all of the cube files including MOLAP aggregationtables or ROLAP aggregation and drill-through tables. Specifically, you can manuallycopy the following:

Manually Copying or Moving SAS OLAP Cube FilesThe core files of a SAS OLAP cube are created in a subdirectory that has the same

name as the cube in the cube’s path. The cube’s path is specified with either of thefollowing:

� the SAS OLAP Cube Studio, Cube Designer Wizard. In the Cube Designer -General window, enter a file path in the Path field.

� the PATH= option in PROC OLAP.

For example, if you create the cube "OrionStar" in the cube pathmyserver\testolap\testcubes, then the cube files are stored in the pathmyserver\testolap\testcubes\OrionStar. When you choose to copy or move the cube toyour target cube path, you should perform the following steps:

1 Create a subdirectory with the cube’s name. For example, if you want to copy ormove the cube to otherserver\prodolap\prodcubes, you would create the directoryotherserver\prodolap\prodcubes\OrionStar.

2 Copy or move the cube files to the target cube subdirectory. This includes thefollowing files:

� cubename.cube (in our example; OrionStar.cube)� captiontrees� fmtcaps� mbrtrees� propcaps (does not exist for all cubes)

You can use standard operating system functions to copy or move the files.

Note: You should ensure that the target files have the same operating systempermissions as your original files. �

Manually Copying MOLAP FilesSAS 9.1.3 OLAP cubes store aggregated data values in tables that have the same file

structure as SAS Scalable Performance Data (SPD) Engine tables. These files cannot bemoved using operating system commands. They must be moved by the SAS PROCCOPY utility. This is necessary in order to correctly update the internal structure of theSPD files as they store path information in their header portion.

By default, the cube’s aggregation table and index files are stored in the cubesubdirectory in the cube’s path. However, you can specify alternate locations for thedata and index portion of the aggregation tables. For more information, see “Changinga Cube’s Data and Index Paths” on page 62.

Page 69: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Manually Copying and Moving SAS OLAP Cubes 61

To copy the aggregation files for the OrionStar cube (assuming the aggregation filesare in the cube path), you assign libref IN to the original location and the libref OUT tothe new location. Both LIBNAME statements should use the SPD Engine. You canthen use the PROC COPY statement to copy the files:

libname in spde "\\myserver\testolap\testcubes\OrionStar";libname out spde "\\otherserver\prodolap\prodcubes\OrionStar"proc copy in=in out=out;run;

If you have specified an alternate location for the data and index files as described in“Changing a Cube’s Data and Index Paths” on page 62, then you must use theINDEXPATH= and DATAPATH= options on the target LIBNAME statement (that is,the OUT libref):

libname in spde "\\myserver\testolap\testcubes\OrionStar";libname out spde "\\otherserver\prodolap\prodcubes\OrionStar"indexpath=("\\otherserver\olapindexes") datapath=("\\otherserver\olapdata");proc copy in=in out=out /* move */;run;

There are some specific restrictions that apply to using the PROC COPY statement.You can only copy or move cube data by using PROC COPY under the followingconditions:

� if you have not specified a specific index path or data path by clicking the Advancedbutton in the Generated Aggregations window. In this case the aggregations arestored in the cube path and will be moved with the PROC COPY statement.

� if you have specified a global index path or data path only in the PerformanceOptions window. All aggregation files will be stored in the global path and will bemoved with the PROC COPY statement so long as you have specifiedINDEXPATH= or DATAPATH= on the SPDE LIBNAME statement.

Note: If you have specified INDEXPATH= or DATAPATH= on specific aggregations,you cannot use PROC COPY to move your MOLAP aggregation tables. You will need torecreate the cube, using the short form of PROC OLAP, in order to get the aggregationfiles in the correct location. �

Manually Copying ROLAP Files

SAS OLAP cubes can use ROLAP tables for the following uses:

� drill-through tables

� aggregation tables

� input data (if you used the NO_NWAY option)

� format catalogs (used by any of the above)

These tables can be stored in many formats including SAS tables, SPD Engine tables,SPDS tables, and tables in external RDBM systems. You can use PROC COPY to copyor move SAS tables, SPD Engine tables, and SPDS tables. You can use standardoperating system functions to copy or move tables in external RDBM systems.

When you copy or move any of these files, you should verify that your target SASOLAP Server has access to those files. In addition, you will need to change theLIBNAME specifications to point to the new file locations. Libnames for an OLAPserver are allocated by using an AUTOEXEC file during the SAS OLAP Serverinvocation or by using pre-assigned libraries.

Page 70: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

62 Accessing OLAP Cubes from SAS: SQL Pass-Through Facility for OLAP � Chapter 4

Changing a Cube’s Data and Index Paths

In the Cube Designer wizard, the Performance Options window (for GeneratedAggregations) contains two settings that you can modify:

� Location of index component files

� Location of partitions in which to place aggregation table data

You can access the Performance Options window by clicking the Advanced button in theCube Designer - Generated Aggregations window. Select the Global tab. These optionsare comparable to the INDEXPATH= and DATAPATH= options in PROC OLAP. Formore information about aggregation performance options, see “Performance Options -Global Tab” in the SAS OLAP Cube Studio Help.

Accessing OLAP Cubes from SAS: SQL Pass-Through Facility for OLAP

The SQL Pass-Through facility enables a SAS user to connect to an OLAP server andexecute cube queries within the PROC SQL environment. PROC SQL establishes aconnection to an OLAP server by using the PROC SQL CONNECT statement.

After a connection is made to the OLAP server, multiple queries can be submitted byusing the OLAP query language, Multidimensional Expressions (MDX). These queriesare run against existing OLAP cubes. A PROC SQL query is then closed after allobservations (rows) of data are returned.

To disconnect from the server, you must submit the PROC SQL DISCONNECTstatement.

The main function of the SQL Pass-Through facility for OLAP is to query data, butMDX commands can be submitted that create named sets, globally scoped sets,drill-through paths, and other OLAP components. Additionally, named sets that arecreated by using MDX can then be used to run queries. It is important to note thefollowing conditions:

� These sets are only available during the current PROC SQL session.

� Other PROC SQL sessions cannot access or reference these sets.

� After a PROC SQL connection is disconnected, any session-created sets arediscarded.

Any libraries that are required for cube queries are obtained from the metadatarepository when the cube is first loaded on the server. These libraries are dynamicallyassigned when PROC SQL establishes a connection to an OLAP server.

Conversion IssuesOLAP cube data is multidimensional and flexible in regard to data name lengths and

restrictions. However, when PROC SQL sends a query to the OLAP server, data isreturned in a flattened, tabular format that contains rows (observations) and columns(variables).

The SAS OLAP Server has unique naming conventions that specify valid columnnames, lengths, and types. Column names that are returned from SAS OLAP cancontain characters (periods, spaces, brackets) and can be unrestrained in length.Additionally, OLAP types can be variable-length strings, floating-point numbers, orintegers. This differs from SAS data set naming conventions, and some conversion isnecessary.

Page 71: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � PROC SQL Syntax 63

VALIDVARNAMEThe SQL Pass-Through facility supports the existing SAS option VALIDVARNAME.

You can specify the VALIDVARNAME option to control variable names. The currentdefault setting for VALIDVARNAME is V7, and variable names can be a maximum of32 characters in length. Each variable must start with a letter or the underscorecharacter and can contain letters, underscores, and numbers. Uppercase and lowercaseletters are also allowed.

When converting column names to SAS variable names, the SQL Pass-Throughfacility for OLAP will

� truncate the column name to the maximum size that is allowed.

� replace any invalid characters with an underscore.

� use a numeric suffix to differentiate between duplicate variable names that aregenerated during the data conversion.

Note: For additional information about naming restrictions for SAS OLAP Server,see “Naming Guidelines for SAS OLAP Server” on page 108. �

Note: For further information about the VALIDVARNAME= system option, see“VALIDVARNAME=System Option” and “Names in the SAS Language” in the SASLanguage Reference: Dictionary. �

Data TypesOLAP query results that contain member names or strings are converted to a fixed

length CHAR type. All OLAP numeric types are converted to standard SAS numerictypes (8-byte floating point). Missing values are handled by standard SAS conventions.

PROC SQL SyntaxHere is an example of the basic syntax that is used to connect to an OLAP server and

execute a cube query:

proc sql;connect to dbms-name (connection options);execute (MDX query);select . . . from connection to remote | alias (dbms-query);disconnect from dbms-name;quit;

CONNECT TO REMOTEestablishes a connection to a remote DBMS or to remote SAS data through a SASserver. This statement is required. Remote SQL Pass-Through (RSPT) does notsupport implicit connection.

DBMS=dbms-namespecifies the name of the remote DBMS that you want to connect to. For SASOLAP Server, the dbms-name is saseolap or olap.

DISCONNECT FROM REMOTE | aliasends the connection to the remote DBMS or to the SAS SQL processor in theserver SAS session.

EXECUTE (SQL-statement) BY REMOTE | aliasspecifies an SQL statement to be executed by the SAS SQL processor or by theremote DBMS in the server SAS session.

Page 72: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

64 SQL Pass-Through Example � Chapter 4

SELECT . . . FROM CONNECTION TO REMOTE | alias (dbms-query);specifies the connection to the remote SAS SQL processor or the remote DBMS asthe source of data for the SELECT statement and the recipient of the dbms-query.

Here are the bridge server connection-options:

HOST=machine-namespecifies either the DNS name or the IP address of the machine that is hosting theOLAP server.

PORT=port-number | SERVICE=service-nameeither the port-number or service-name is required. The port-number specifies thenumeric value of the port on which the OLAP server resides. The service-name isused to look up the port number of the machine that is hosting the OLAP server.

USER=userida string that specifies the user’s identification for the specified OLAP server. Ifincluded, this option is enclosed within parentheses with the required argumentsand any other options.

PASS=passworda string that specifies the password for the user who is identified with the USER=option. If included, this option is enclosed within parentheses with the requiredarguments and any other options.

This is the COM server connection-option:

machine-namespecifies either the DNS name or the IP address of the machine that is hosting theOLAP server. This is the only argument that is used for COM server connections.

Note: For detailed information about PROC SQL syntax see “Overview of thePass-Through Facility” in SAS/ACCESS for Relational Databases: Reference and“Syntax for Remote SQL Pass-Through (RSPT) Facility” in SAS/SHARE User’s Guide. �

SQL Pass-Through ExampleIn the following example, PROC SQL connects to the pass-through facility for OLAP

to create a new data set named temp, which contains all the variables that are returnedfrom the multidimensional expression (MDX) defined in the SELECT query. The OLAPserver returns query results in a tabular format known as a flattened rowset. The tablerows become the observations of the output data set, and the table columns become thevariables. After all the rows are returned, PROC SQL closes the query. The serverconnection is terminated when the program encounters a DISCONNECT statement orwhen the PROC SQL step ends.

Note: Because the OLAP server does not impose the same restrictions on columnnames, types, and lengths that SAS imposes on data sets, some conversion might berequired. �

100 proc sql;101 connect to olap (host=localhost service=olap1);102 create table temp as select * from connection to olap103 (104 select { dealers.dealer.members } on 0,105 { [cars].[Car].members,106 [cars].[Color].members } on 1107 from mddbcars

Page 73: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Specifying Calculated Members 65

108 );109 disconnect from olap;110 quit;

Specifying GIS Map Information for a DimensionThe SAS OLAP Cube Studio Specify Map function allows you to store ESRI

Geographic Information System (GIS) spatial map information in the SAS MetadataRepository. This GIS information can then be read by the SAS OLAP Server andreturned during a cube query. You can set up the ESRI ArcGIS server information inthe metadata repository by using the Map Service Manager plug-in in SASManagement Console. Users can access the functionality through the SAS Web OLAPViewer and SAS Web OLAP Viewer for Java.

The Specify Map function enables you to identify a geography-based dimension andthen assign ESRI spatial map information to that dimension. To define GIS informationfor a SAS OLAP cube, you identify a dimension as a geographic-type dimension (GEO)in the Dimension Designer - General window. You can have only one GEO dimensionper cube. After a dimension has been marked as a GEO-type dimension, the SpecifyMap button becomes active on the Cube Designer - Dimensions window.

Note: The Specify Map button is dimmed until a GEO dimension has been specifiedfor a cube. �

The Specify Map window enables you to assign ESRI spatial map information tolevels of the GEO-type dimension. You can add map information to an existing cube,modify map information for a cube, or delete the map information from a cube. WhenESRI map information is added to a cube, the property objects for the mapped cubelevels are listed in the Cube Designer’s Member Property window. From here you canmodify the format, caption, and description for the member property. These memberproperties are named SAS_SPATIAL_ID by default.

Note: If a dimension is changed from type GEO to Standard or Time, all the mapinformation is removed. �

For further information on the Specify Map window, see the SAS OLAP Cube StudioHelp.

Specifying Calculated MembersAfter you have built a cube, you might find it necessary to add members or measures

to the cube. You can add calculated members to a cube in the following ways:� manually by submitting PROC OLAP code with the DEFINE statement. See

“DEFINE Statement” on page 102.� using the Calculated Members plug-in in SAS OLAP Cube Studio.

The Calculated Members plug-in enables you to add new members for the Measuresdimension. A calculated member is a definition (for a dimension member) that youcreate and store with the cube. The calculated member value is generated later duringquery time. You can also define a calculated member as a measure.

Page 74: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

66 Using the Calculated Members Plug-in � Chapter 4

Using the Calculated Members Plug-inThe Calculated Members plug-in can be accessed from the SAS OLAP Cube Studio

Shortcuts Bar or from the Tools menu. Click Calculated Members to open the CubeList dialog box. In this dialog box, select a cube from the repository tree and select OK.The Calculations for cube dialog box opens.

On the Calculations for cube dialog box you can add new calculated members ormodify existing members for the selected cube. The list box displays all calculatedmembers that are defined in the metadata for the selected cube. Select Add to launchthe New Member Wizard and define a new calculated member.

To modify an existing member, select the member and then click Edit. The Edit aCalculated Member dialog box opens.

Selecting Calculation TypesWhen you click Add in the Calculations for cube dialog box, the New Member Wizard

is launched. On this window, you select the type of calculation that you want to create.You can select one of the following types:

� Simple Calculations to create a simple calculation formula. See “SimpleCalculations” on page 66.

� Time Analysis Calculations to create a time-based calculation formula. See “TimeAnalysis Calculations” on page 67.

� Custom Calculations to enter a custom calculation formula. See “CustomCalculations” on page 67.

Simple CalculationsOn this window, you select the variables to create a simple calculation. You can

select one of the following calculation types:� Sum� Difference� Ratio� Percent Increase� Percent Decrease� Distinct Count

The Formula drop-down lists for the members are populated with all measures,including calculated measures. The Formula panel changes depending on thecalculation-type radio button you select. When a formula is selected, the Formula panelis populated with drop-down lists appropriate for the selected calculation. A membermust be selected in each list. The member selections for the different formulas arepreserved across formulas within a type.

If you select Distinct Count, a selection tree is displayed. Each dimension has anode that expands into its hierarchies and then into the levels for each hierarchy. Onevariable in the hierarchy tree must be selected.

For further information on the Simple Calculations window, see the SAS OLAP CubeStudio Help.

Page 75: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Modifying and Updating Cubes � Using the Calculated Members Plug-in 67

Time Analysis CalculationsOn this window, you select the variables to create a Time calculation. You can select

one of the following calculation types:

� Opening Balance

� Closing Balance

� Rolling Total

� Average Over Time

� Compare Parallel Periods

� Compare Consecutive Periods

The Formula panel changes depending on the time-calculation radio button that youselect. The Existing measure drop-down list is populated with all measures, includingcalculated measures. The Time period drop-down list is populated with members fromthe Time dimension. A member must be selected in each list. The member selectionsfor the different formulas are preserved across formulas within a type.

Note: This option is not available if there are no Time-type dimensions for thecube. �

For further information on the Time Analysis Calculations window, see the SASOLAP Cube Studio Help.

Custom CalculationsOn this window, you enter the variables to create a custom calculation. You can enter

the following:

Parentdimension

specifies a parent dimension for the new calculated member that youare creating. The default dimension is Measures. If you select adimension other than Measures, this field will initially be populatedwith the unique name for the default hierarchy’s all member.

Parent member specifies a parent member for the new calculated member. Use theBrowse button to display a tree of valid members for the dimension.If you select the Browse button and the cube physically exists, youwill be prompted to log on to an OLAP server, if you haven’t already.

Note: If the cube exists, you must connect to the OLAP serverso that the valid members can be retrieved from the server. If thecube does not exist or a connection cannot be made to the OLAPserver, the valid members displayed in the tree will be the allmembers for each of the hierarchies for the dimension. �

Name specifies a name for the custom calculation.

Formula specifies an MDX formula for the new calculated member.

Click Verify to validate the MDX formula entered in the Formula text box. Thisfunction is only available for cubes that physically exist. When you select Verify, theLog on to an OLAP server dialog box opens. Select a server and enter a user ID andpassword. A connection will be made to the selected OLAP server. Click Clear to clearthe contents of the Formula text box.

The Generated MDX text area allows you to view the MDX code that currently existsfor the selected cube and any new MDX code that is entered in the Formula text box.

For further information on the Custom Calculations window, see the SAS OLAPCube Studio Help.

Page 76: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

68

Page 77: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

69

C H A P T E R

5Using SAS OLAP Cubes

Using a Cube with ADO MD 69Using a Cube with OLE DB for OLAP 69

Using a Cube with Additional SAS Products 70

SAS Products That Use SAS OLAP Cubes 70

SAS Enterprise Guide 70

SAS AppDev Studio 70SAS Information Map Studio 71

SAS Web Report Studio 71

SAS Web OLAP Viewer 72

SAS Web OLAP Viewer for Java 72

SAS Web OLAP Viewer for .NET 73

Using a Cube with Third-Party Clients 73Microsoft Excel 2000 and Excel 2002 PivotTable 73

Saving a PivotTable as a Web Page 75

Microsoft Office Web Components 2000 and 2002 PivotTable 75

ProClarity Professional 76

Using a Cube with ADO MD

Applications gain access to SAS OLAP cubes through ADO MD. ADO MD is anindustry standard programming interface to multidimensional data. It offers the samefunctionality as OLE DB for OLAP but in a simpler programming model. AccessingSAS OLAP cubes through ADO MD requires the SAS OLAP Data Provider, which is acomponent of SAS Integration Technologies. The SAS OLAP Data Provider is installedwith the SAS Integration Technologies Client for Windows 9.1. See the SAS DataProviders: ADO/OLE DB Cookbook for more information about IOM data providerusage with ADO MD.

Using a Cube with OLE DB for OLAP

In addition to ADO MD, applications gain access to SAS OLAP cubes through OLEDB for OLAP, an industry standard set of programmable Component Object Model(COM) interfaces that expose multidimensional data. For SAS OLAP cubes, the OLEDB interfaces are exposed by the SAS OLAP Data Provider, a component of SASIntegration Technologies. The SAS OLAP Data Provider enables applications toperform data analysis by providing a means to view schema information, submit MDXqueries, and retrieve results. The SAS OLAP Data Provider is installed with the SAS

Page 78: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

70 Using a Cube with Additional SAS Products � Chapter 5

Integration Technologies Client for Windows 9.1. See the SAS Data Providers: ADO/OLE DB Cookbook for more information about IOM data provider usage.

Using a Cube with Additional SAS Products

SAS Products That Use SAS OLAP CubesThe following additional SAS products access SAS OLAP cubes:� “SAS Enterprise Guide” on page 70� “SAS AppDev Studio” on page 70� “SAS Information Map Studio” on page 71� “SAS Web Report Studio” on page 71� “SAS Web OLAP Viewer” on page 72� SQL Pass-Through Facility for OLAP. For more information, see “Accessing OLAP

Cubes from SAS: SQL Pass-Through Facility for OLAP” on page 62.

Note: The SQL Pass-Through Facility for OLAP does not require additionallicensing. �

See the product help and documentation for these products for information on how toaccess SAS OLAP cubes.

SAS Enterprise GuideSAS Enterprise Guide is a project-oriented Windows application that is designed to

enable quick access to much of the analytic power of SAS software for statisticians,business analysts, and SAS programmers.

SAS Enterprise Guide is an ODBO-compliant OLAP Viewer. When accessing OLAPcubes via ODBO, SAS OLAP Server acts as an Open OLAP Provider and EnterpriseGuide is an Open OLAP Consumer.

SAS Enterprise Guide provides an OLAP-specific tool called the OLAP Analyzer. TheOLAP Analyzer (formerly named the MDDB Viewer) has been simplified by thedevelopment of a new user interface and wizards for common tasks. You can view thedetailed data that makes up any tuple (that is, a pairing of items from two dimensions)in your OLAP cube. In addition, you can add calculated members, or formulas, to adimension in an OLAP cube. The calculated members can be computed from othermembers or values and must return either strings or numeric values.

SAS Enterprise Guide also enables you to create SAS Stored Processes and to storethat code in a repository that is available to a SAS Stored Process Server. (Storedprocesses are SAS programs that are stored on a server and are executed by clientapplications.) Stored processes are used for Web reporting and analytics, among otherthings.

For more information about SAS Enterprise Guide, see the SAS Enterprise GuideHelp, which is available from within the product.

SAS AppDev StudioSAS AppDev Studio provides a single interface for the development of thin- and

power-client business intelligence applications. SAS AppDev Studio supports every

Page 79: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Using SAS OLAP Cubes � SAS Web Report Studio 71

major Web standard on both the server and the client side. CIOs can choose SAS astheir standard for business intelligence with the knowledge that the analytical power ofSAS can be deployed throughout the organization, regardless of the applicationsdevelopment and information distribution architecture.

Using tools that are part of SAS AppDev Studio, you can develop applet-based orservlet-based (including JavaServer Pages) OLAP applications.

For information, examples, and reference information on this product, consult thefollowing sources:

� SAS AppDev Studio Help� SAS AppDev Studio Developer’s Site at the SAS Customer Support Center,

support.sas.com/rnd/appdev.

SAS Information Map StudioSAS information maps can translate business questions into the necessary MDX code

to access SAS 9.1 OLAP structures. SAS Information Map Studio is a Java applicationthat enables data modelers and data architects to create and manage SAS InformationMaps, which are business metadata about your physical data. Information maps enableyou to surface your data warehouse data in business terms that typical business usersunderstand, while storing key information that is needed to build appropriate queries.Information maps provide the following benefits:

� Users are shielded from the complexities of the physical data.� Data storage is transparent to the consumers of information maps, regardless of

whether the underlying data is relational or multidimensional, or whether thedata is in a SAS data set or in a third-party database system.

� Business formulas and calculations are predefined, which makes them usable on aconsistent basis.

� Users can easily query data for answers to business questions without having toknow query languages.

For more information about SAS Information Map Studio, see the SAS InformationMap Studio Help, which is available from within the SAS Information Map Studioproduct.

SAS Web Report StudioSAS Web Report Studio is a Web-based application that enables you to create, view,

and organize reports. You can use SAS Web Report Studio to perform theseOLAP-specific tasks:

� drill and expand tables and graphs� support ragged and unbalanced hierarchies� pivot individual crosstab dimensions� switch dimensions and measures with Data Selection box� synchronize report components to display a common drill state or have them

remain independent

In addition to OLAP-specific tasks, you can perform the following tasks:

Creating reports Beginning with a simple and intuitive view of your data provided bySAS Information Maps (created in SAS Information Map Studio),you can create reports based on either relational ormultidimensional data sources. You can use the Report Wizard to

Page 80: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

72 SAS Web OLAP Viewer � Chapter 5

quickly create simple reports or the Edit Report view to createsophisticated reports that have multiple data sources, each of whichcan be filtered. These reports can include various combinations oflist tables, crosstabulation tables, and graphs. Using the EditReport view, you can adjust the style to globally change colors andfonts. You can also insert stored processes that take the results froma block of SAS code and embed those results directly into a report.

Viewing andworking withreports

While viewing reports using a thin client (a Web browser), you canfilter, sort, and rank the data that is shown in tables,crosstabulations, and graphs. With multidimensional data, you candrill down on data in crosstabulations and graphs and drill throughto the underlying data.

Organizingreports

You can create folders and subfolders for organizing your reports.Information consumers can use keywords to find the reports thatthey need. Reports can be shared with others or kept private.

Printing andexportingreports

You can preview a report in PDF and print the report, or save ande-mail it later. You have control over many printing options,including page orientation, page range, and size of the tables andgraphs. You can also export data as a spreadsheet and exportgraphs as images.

For more information about using SAS Web Report Studio, see the SAS Web ReportStudio Help, which is available from within the product. For information aboutadministrative tasks associated with SAS Web Report Studio, see the SAS IntelligencePlatform: Web Application Administration Guide, which is available atsupport.sas.com.

SAS Web OLAP ViewerSAS Web OLAP Viewer is a data exploration tool designed for business analysts who

need to look at large volumes of data quickly from varying perspectives. It lets businessusers look at data from multiple angles, drill into detail data, and save theirinformation for easy Web-based report creation.

SAS Web OLAP Viewer surfaces SAS 9 OLAP cubes, OLAP Information Maps, andOLAP-based data explorations. It provides an easy-to-use interface from which you canselect a data source, view the data, and customize your view with features such assorting and filtering. With SAS Web OLAP Viewer you can perform these tasks:

� apply filters and rankings to cubes� calculate new measures� sort data values� add totals and subtotals� save and reload changes to your data view� create PDF for printing� export to Excel

There are two versions of the SAS Web OLAP Viewer: SAS Web OLAP Viewer forJava and SAS Web OLAP Viewer for .NET. For further information on SAS Web OLAPViewer, see the SAS Web OLAP Viewer Help.

SAS Web OLAP Viewer for JavaSAS Web OLAP Viewer for Java is a standalone, browser-based, data exploration

tool. It is a Java Web application and is available as part of the SAS BI Server or SAS

Page 81: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Using SAS OLAP Cubes � Microsoft Excel 2000 and Excel 2002 PivotTable 73

Enterprise BI Server. It provides you advanced OLAP navigation and the ability to useESRI maps to visualize data. You can access OLAP data with SAS Web OLAP Viewerfor Java in two ways:

� By using SAS Information Maps, you can control the way users access datasources.

� By using direct access to cubes, you can reduce the amount of preparation workthat is necessary before data access.

SAS Web OLAP Viewer for Java also enables you to design new calculated measuresat runtime. You can then publish your views as reports in SAS Web Report Studio.

SAS Web OLAP Viewer for .NETSAS Web OLAP Viewer for .NET is a Microsoft .NET Web application. It provides

you advanced OLAP navigation and the ability to edit MDX queries directly. SAS WebOLAP Viewer for .NET can access any standards-compliant OLE DB for OLAP datasource, such as the following:

� SAS OLAP Server� Microsoft Analysis Services

SAS Web OLAP Viewer for .NET also enables you to design new calculated measuresat runtime. Calculated measures let you use the full power of MDX to createcalculations based on measures within your OLAP data source. You can distribute yourresults in the following ways:

� exporting slices from your OLAP data source to flat tables or Microsoft Excelspreadsheets

� exporting slices to SAS Enterprise Guide for further analysis using analytics orforecasts

Using a Cube with Third-Party ClientsThe SAS OLAP Server exposes multidimensional data through OLE DB for OLAP

interfaces. Supporting these industry standard interfaces enables the SAS OLAPServer to integrate with third-party clients. The user interfaces for these clients varywidely. To ensure successful integration with the SAS OLAP Server, usage guidelinesfor some third-party clients have been established.

Microsoft Excel 2000 and Excel 2002 PivotTableTo view SAS OLAP cubes in Microsoft Excel, you must identify the server where your

cubes are stored and the cube you want to analyze with the PivotTable and PivotChartWizard.

1 In Microsoft Excel, select Data � PivotTable and PivotChart Report. Thisopens the PivotTable and PivotChart Wizard.

2 At the PivotTable and PivotChart Wizard, select the radio buttons for Externaldata source and PivotTable. Select Next.

3 In the PivotTable and PivotChart Wizard window, select Get Data. This opens theChoose Data Source window.

� On the OLAP Cubes tab, select <New Data Source>.� Select OK. This opens the Create New Data Source window.

� In field 1, enter the name that you want to associate with the cube datayou are accessing.

Page 82: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

74 Microsoft Excel 2000 and Excel 2002 PivotTable � Chapter 5

Note: This is the name that Excel uses to store your work. �� In field 2, select SAS OLAP Data Provider 9.1.� In field 3, select the Connect button. This opens the Data Link

Properties window. In the Data Source field, enter the name of the SAS9 OLAP Server you are accessing. If necessary, enter your user ID andpassword for accessing the server. Select the SAS Protocol (Bridge,Com, or Corba). If you select Bridge, then you must specify the SASService Name/Port. Select OK.

� If the connection to the server is successful, field 4 will be active.

Note: A successful connection depends on several factors such asaccurate data source and port information, accurate user accountinformation, and whether the server is running and can be accessed.For details about SAS Protocol, SAS Service Name, and other connectionproperties, see “SAS OLAP Provider Connection Properties” in the SASData Providers: ADO/OLE DB Cookbook. �

Select the cube that you want to analyze in Excel.

Note: If field 4 is active, but there are no cubes shown in the dropdown box, this means the OLAP server was unable to locate any cubes.A possible cause is that your OLAP server is not associated with thecorrect OLAP schema. You can determine the OLAP schema assigned toyour OLAP server from the SAS Management Console. Then in SASOLAP Cube Studio, verify that the OLAP schema has cubes. For moreinformation about OLAP schemas see the SAS Intelligence Platform:Data Administration Guide. �

� You must select the radio button Save my user ID and password inthe data source definition when you connect to a secure server. Ifyou select the radio button, then a message window opens that informsyou how the user ID and password will be stored in the data sourcedefinition. At this point you must confirm your selection of the radiobutton. There are variations in performance between Microsoft Excel2000 and Microsoft Excel 2002. If you do not select the radio button,then when you connect to a secure server, the connection will fail in oneof these ways:

� In Microsoft Excel 2000, you will return to the Choose Data Sourcewindow in the PivotTable and PivotChart Wizard.

� In Microsoft Excel 2002, the Data Link Properties window reloads,which allows you to re-enter the data source information.

� When you finish entering information in the Create New Data Sourcewindow, select OK. At this point Excel saves the data as a Microsoftquery (OQY) file that you can later reference and load in Excel.

After completing the fields in the Create New Data Source window, you returnto the Choose Data Source window. You see your new data source listed on theOLAP Cubes panel. Select OK. This returns you to the PivotTable and PivotChartWizard window. Select Next. This loads the PivotTable and PivotChart Wizard.

4 At On the PivotTable and PivotChart Wizard, select where you want to put thePivotTable. You can choose to place the PivotTable in a New worksheet or in theExisting worksheet. Select Finish. The PivotTable is loaded.

5 At the worksheet and PivotTable menu, select cube data items to populate thecolumns and rows of the PivotTable. Use the drag-and-drop selection method tomove the data buttons to the PivotTable. For the PivotTable data area, select thedata buttons that are measures of the cube data.

Page 83: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Using SAS OLAP Cubes � Microsoft Office Web Components 2000 and 2002 PivotTable 75

6 From this point, use standard Microsoft Excel functionality to view cube data.

Note: You must have Microsoft Query installed to view OLAP cubes in MicrosoftExcel. �

Saving a PivotTable as a Web PageWhen you save a PivotTable as a static Web page in Microsoft Excel 2002, the user

password is not automatically saved with the HTML file that is generated. For Excel2002 PivotTables that are connected to a secure OLAP server, this can result in anerror message when the HTML file is loaded into Internet Explorer.

In Microsoft Excel 2002, when you selectFile � Save as Web Page a messagewindow displays stating that the user password will not be saved. You then have anopportunity to continue saving the HTML file or not. If you choose to save the HTMLfile without the password, an error message might be displayed when the user tries toload the HTML file in Microsoft Internet Explorer. To prevent this error message, youcan manually edit the HTML file to include the user password. For example, in thisconnection tag, you would add the password option, password=mypass; to the<Connection> string.

<Connection>Provider=sas.OLAPProvider.9.1;User ID=&userid;DataSource=SAS OLAP Provider Server;Location=&location;Mode=ReadWrite|Share Deny None;SAS Logical Name="";SAS Machine DNS Name=&SASMachineDNSName ;SAS Port=&Port;SAS Protocol=2;SAS Server Type=2</Connection>

Microsoft Office Web Components 2000 and 2002 PivotTableFor the Microsoft Office Web Components 2000 and 2002 PivotTable user interface,

the PivotTable connection string must specify the provider and data source. Specifically,the connection string must specify

� Provider=sas.OLAPProvider.9.1� the data source as a URL/URI style string that contains all the necessary

connection properties:

olapServerName&Property1=value&property2=Value&property3=value

The string must begin with the name of the OLAP Server to which you areconnecting. To list additional connection properties, follow the server name with“&” and list “property name=property value” pairs, delimited by “&”.

Note: All connection properties, with the exception of provider, must bespecified within the data source string. �

Note: For a description of these properties see the SAS Data Providers: ADO/OLE DB Cookbook. In particular, see the sections “Connections and Data Sources”and “Connecting to a Remote SAS OLAP server.” �

Here is an example of an HTML page using a Microsoft Office 2000 PivotTable inconjunction with the SAS OLAP Server. The data source string specifies an OLAPserver with the name mktg.unx.com, a SAS port of 6176, and the ProtocolBridge forSAS protocol defined as 2.

<HTML><BODY ONLOAD = "Setup_PT()"><OBJECT ID="PivotTable1"

CLASSID="CLSID:0002E520-0000-0000-C000-000000000046"

Page 84: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

76 ProClarity Professional � Chapter 5

style="HEIGHT: 500px; WIDTH: 500px"></OBJECT><SCRIPT language=VBScript>

Sub Setup_PT()

constr="Provider=sas.OLAPProvider.9.1;DataSource=mktg.unx.com&SAS Port=6176

&Location=localhost&SAS Protocol=2’’PivotTable1.ConnectionString=constrPivotTable1.DataMember="CAMPAIGN"PivotTable1.ActiveView.AutoLayout

End Sub</SCRIPT>

</BODY></HTML>

For Microsoft Office 2002 PivotTable Web Components, useCLASSID=“CLSID:0002E552-0000-0000-C000-000000000046”.

ProClarity ProfessionalYou can access SAS OLAP cubes from within ProClarity Professional. The following

steps show you how to load a SAS OLAP cube for analysis:1 From the File menu, select Options � OLAP Provider � Change ProviderSAS

OLAP Data Provider 9.1 � OKOn the OLAP Provider tab of the Optionswindow, SAS OLAP Data Provider 9.1 should now appear as the current provider.Select OK.

2 From the File menu, select Open Cube. This opens the Connect window.3 In the Server field, enter the name of the SAS OLAP server that you are

connecting to as well as the user name and password. Select OK. This loads theOpen Cube window.

4 In the Open Cube window, select a cube to open. Select OK. The cube is loaded intothe ProClarity workspace.

5 From this point, use standard ProClarity functionality to manipulate the SASOLAP cube.

Note: The ProClarity interface currently enables you to specify the data source thatyou are connecting to as well as the user name and password. However, it does notallow you to specify other provider properties that might be necessary to establish aserver connection such as SAS Port or SAS Protocol. For further information about howto set additional SAS Provider properties, see the SAS Data Providers: ADO/OLE DBCookbook. �

Note: In ProClarity you can access and view measures by selecting View � MDXEditor. The cube measures are displayed in the lower metadata window. However,when viewing SAS OLAP cubes in ProClarity, user-defined measures are notrecognized. �

Page 85: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

77

A P P E N D I X

1The OLAP Procedure

The OLAP Procedure 78Syntax: OLAP Procedure 78

PROC OLAP Statement 79

Options 79

METASVR Statement 85

Required Argument 85Options 85

DIMENSION Statement 86

Required Arguments 87

Options 87

LEVEL Statement 89

Required Arguments 90Options 90

PROPERTY Statement 91

Required Arguments 92

Options 92

HIERARCHY Statement 93Required Arguments 93

Options 94

MEASURE Statement 95

Required Arguments 95

Options 98AGGREGATION Statement 99

Required Arguments 100

Options 100

DROP_AGGREGATION Statement 101

Required Arguments 102

DEFINE Statement 102Required Arguments 104

UNDEFINE Statement 104

Required Arguments 105

USER_DEFINED_TRANSLATIONS Statement 105

Required Argument 106SAS Servers and Character Encoding 106

Tables Used to Define Cubes 107

Naming Guidelines for SAS OLAP Server 108

Loading Cubes 109

Loading Cubes from a Detail Table 109Loading Cubes from a Star Schema 110

Loading Cubes Using Summarized Data 112

Maintaining Cubes 113

Page 86: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

78 The OLAP Procedure � Appendix 1

Building a Cube from an Existing Definition 113Adding Aggregations to an Existing Cube 114

Deleting Aggregations from an Existing Cube 114

Deleting Cubes 115

Specialized Options for PROC OLAP 115

Options for Managing Ragged Hierarchies 115Options Used for Performance 116

The OLAP Procedure

The OLAP procedure is one of the tools in SAS 9.1 that you can use to create anddelete cubes, and add and delete aggregations.

Note: You can also use the Cube Designer wizard to maintain OLAP cubes. TheCube Designer wizard can be launched from SAS Data Integration Studio and SASOLAP Cube Studio. Help on using the wizard to build cubes is available from withinboth applications. �

In addition to the basic cube creation tasks, PROC OLAP also enables you to

� build cubes with ragged hierarchies

� control options that can be used to optimize cube creation and query performance

� specify data set options on detail, fact, dimension, and drill-through tables

� create TIME dimensions

� design dimensions that have more than one hierarchy

� define global calculated members and named sets

� include SAS code when you submit PROC OLAP in batch mode

� read alternate locale data sets and create locale-specific metadata for use at querytime

Syntax: OLAP Procedure

PROC OLAP < option(s)>;

METASVR OLAP_SCHEMA=’schema-name’ < option(s)>;

DIMENSION dim-name HIERARCHIES=(hier–name) <option(s)>;

HIERARCHY hier-name LEVELS=(level–name1<level–name2 ... level-nameN>)<option(s)>;

LEVEL level-name <option(s)>;

PROPERTY prop-name LEVEL=level-name<option(s)>;

MEASURE measure-name STAT=statname < option(s)>;

AGGREGATION level-list </option(s)>;

DROP_AGGREGATION level-name1 < level-name2 ...level-nameN> /NAME=’aggregation-name’ ;

DEFINE MEMBER | SET ’member-or-set-name’ AS ’mdx-expression’ ;

UNDEFINE MEMBER | SET ’member-or-set-name’ ;

USER_DEFINED_TRANSLATIONS one or more of 56 locale specifications;

Page 87: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options 79

PROC OLAP StatementThe PROC OLAP statement specifies the input data source, cube name, and path.

This statement can also be used to� specify options that might improve query performance� delete cubes� specify global settings for handling missing hierarchy members in ragged and

unbalanced hierarchies.

PROC OLAP <option(s)>;

OptionsNote: For information about options that can be used to optimize cube creation and

query performance, see “Options Used for Performance” on page 116. �

COMPACT_NWAYspecifies that the cube build will include an additional summarization step that isdesigned to decrease the size of the NWAY aggregation and improve viewingperformance. The amount of improvement depends on the nature of the data. Thecubes that improve the most are those that have the largest number of rows thatcan be included in the additional summarization step.

Candidates for compaction are cubes that are built from star schema, where thecube does not define levels for all columns in all dimension tables. This can resultin a fact table that contains many rows that belong to the same leaf member of agiven hierarchy. These are the rows that are summarized to decrease the size ofthe NWAY aggregation.

For example, assume that a cube is built from a star schema that contains aTime dimension table. The Time table contains columns for year, quarter, month,and day, along with a primary key column. If the cube is defined so that the daycolumn is not specified as a level of a time hierarchy, then there are up to 31 keyvalues that refer to each unique combination of year, quarter, and month.Together, these key values define a unique leaf member of that hierarchy. Theseare the values that are summarized at build time.

The amount of compaction in the NWAY aggregation is determined by thenumber of source rows that can be summarized. The number of summarized rowsdepends on the number of unique key values in the fact table that refer to the sameleaf member of a hierarchy. Another compaction factor is the number of rows in thefact table that contain unique combinations of keys; these rows are not compacted.

COMPRESS | NOCOMPRESSspecifies whether or not to store the aggregation tables in a compressed format ondisk.

Note: This option applies to the automatically created NWAY and allaggregations that do not explicitly specify a COMPRESS option in theAGGREGATION statement. �Default: NOCOMPRESS

CONCURRENT=nspecifies the maximum number of aggregations to create in parallel. This optiondoes not apply to the NWAY aggregation, which is always built first (unless theNO_NWAY option is set).Default: 2, which is based on the results of a special algorithm that takes into

consideration the number of aggregations that are being created and the

Page 88: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

80 Options � Appendix 1

number of processors that are available. The algorithm assumes that CPUresources should be reserved for creating aggregation indexes.

Tip: So that each built index has a fair share of the assigned INDEXSORTSIZEmemory, INDEXSORTSIZE is divided by the CONCURRENT value. The valueof INDEXSORTSIZE should give each concurrent index build enough memory toat least hold a table PARTSIZE. For best performance, INDEXSORTSIZEdivided by CONCURRENT should be greater than PARTSIZE.

CUBE=cube-namespecifies a valid SAS name for the cube to be created or updated. For namingguidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.

DATA | FACT=dsnamespecifies the data source for the cube. The unsummarized data source can be anySAS data file, including files that are supported by SAS access engines. If you loadthe cube from a star schema, then the dsname is the name of the fact table thatcontains the analysis variables from which to derive the measures for the cube.The fact table must also contain fact keys that correspond to dimension tables inthe star schema.

You can also provide data set options along with DATA | FACT=. Options arestored within the cube and reapplied when the data is accessed at run time. Formore information, see “Data Set Options” in SAS Language Reference: Concepts.

Note: This option is not required if you want to define the cube by using inputdata from a fully summarized external data source (a crossing of all dimensionsknown as an NWAY); in that case, you specify the data source for the cube byusing the TABLE= option in the AGGREGATION statement. �

Interaction: If you load the cube from a star schema, then you must use theDIMENSION statement to

specify the dimension table name (the DIMTBL= option)

specify the dimension (primary) key column (the DIMKEY= option)

specify the column (foreign key) in the fact table that corresponds to thedimension key column (the FACTKEY= option).

DATAPATH=(’pathname’ ...’pathnameN’)specifies the location of one or more partitions in which to place aggregation tabledata. The data is distributed by cycling through each partition location accordingto the partition size (set using the PARTSIZE= option). For example, if you specifyDATAPATH=(’c:\data1’ ’d:\data2’), then PROC OLAP places the firstpartition of each aggregation table into directory c:\data1, the second partition ofeach table into directory d:\data2, the third partition of each table into c:\data1,and so on. It is also possible to have aggregation tables that use less than thespecified number of partitions. For example, your cube might contain anaggregation table that fits entirely into c:\data1.

Note: This option applies to the automatically created NWAY and allaggregations that do not explicitly specify a DATAPATH= option in theAGGREGATION statement. �

Default: The cube subdirectory of the location that is specified by the PATH=option in the PROC OLAP statement

DELETEdeletes the physical cube that is specified with the CUBE= option. It also deletesthe cube’s definition, which is stored in the metadata repository.

Page 89: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options 81

If either the physical cube, its registration, or both are not present, then theDELETE option behaves as explained in the following table:

Note: The DELETE option should only be used if you are recreating a cubefrom a completely different dataset or table. The use of the DELETE option willremove all information about a cube including security information andinformation maps. �

Table A1.1 How the DELETE Option Behaves If the Physical Cube or Its Registration Is Not Present

Physical cube exists Registration exists DELETE option behaves this way

No Yes The physical cube is not deleted. Theregistration is deleted. If there is aregistration, and you use the DELETEoption, the registration is always deletedand you cannot recreate the cube fromthe registration. You can only recreatethe cube from the registration when youuse the DELETE_PHYSICAL option.

No No Fails because there is nothing to delete.

Yes No Fails because the cube cannot be locatedwithout its registration information. Youmust manually delete the cube.

DELETE_PHYSICALdeletes the physical cube that is specified with the CUBE= option but leaves thecube definition intact. This enables you to build a new cube based on the savedcube definition.

If either the physical cube or its registration, or both are not present, then theDELETE_PHYSICAL option behaves as explained in the following table:

Table A1.2 How the DELETE_PHYSICAL Option Behaves If the Physical Cube or Its registration Is Not Present

Physical cube exists Registrationexists

DELETE_PHYSICAL option behavesthis way

No Yes Fails because there is no physical cube todelete.

No No Fails because there is nothing to delete.

Yes No Fails because the cube cannot be locatedwithout its registration information. Youmust manually delete the cube.

DESC | DESCRIPTION=’cube-description’specifies any number of characters to be stored as descriptive text. If the textincludes blank spaces or any characters that are not permitted in a valid SASname, then enclose the text within quotation marks.

DRILLTHROUGH_TABLE | DT_TABLE | DT_TBL=table-namespecifies an optional drill-through table. Drill-through tables can be used by clientapplications to provide a view from processed data into the underlying data source.You can specify the DATA | FACT= table or a different table that includes thenecessary data and columns.

Page 90: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

82 Options � Appendix 1

You can also specify data set options with this option. Options are stored withinthe cube and reapplied when the data is accessed at run time. For moreinformation, see “Data Set Options” in SAS Language Reference: Concepts.

EMPTY_CHAR=‘string’specifies the text string that identifies members of character levels that are to beskipped or disregarded. Members are skipped in order to create ragged orunbalanced hierarchies, as described in “Defining Ragged and UnbalancedHierarchies with PROC OLAP” on page 17.

To be skipped, a member in a character level must have a caption whose valuematches the value of the EMPTY_CHAR= option. For example, if a member in acharacter level is skipped, and if the caption of that member is Empty, then theEMPTY_CHAR= option is specified as follows:

empty_char=’Empty’

The maximum length of the quoted string is 256 characters.Interaction: When specified in the PROC OLAP statement, the

EMPTY_CHAR= option can be overridden by the EMPTY_CHAR= orIGNORE_EMPTY options in a HIERARCHY statement or by the EMPTY= orIGNORE_EMPTY options in a LEVEL statement.To skip members in numeric levels, use the EMPTY_NUM= option.See also “Naming Guidelines for SAS OLAP Server” on page 108.

EMPTY_NUM=‘string’specifies the text string that identifies members of numeric levels that are to beskipped or disregarded. Members are skipped in order to create ragged orunbalanced hierarchies, as described in “Defining Ragged and UnbalancedHierarchies with PROC OLAP” on page 17.

To be skipped, a member in a numeric level must have a caption whose valuematches the value of the EMPTY_NUM= option. For example, if a member in anumeric level is skipped, and if the caption of that member is Empty, then theEMPTY_NUM= option is specified as follows:

empty_num=’Empty’

The maximum length of the quoted string is 256 characters.Interaction: When specified in the PROC OLAP statement, the EMPTY_NUM=

option can be overridden by the EMPTY_NUM= or IGNORE_EMPTY options ina HIERARCHY statement or by the EMPTY= or IGNORE_EMPTY options in aLEVEL statement.Note: If there is no format that is associated with the member value, then

BEST12 is used as the format. �To skip members in character levels, use the EMPTY_CHAR= option.See also “Naming Guidelines for SAS OLAP Server” on page 108.

IGNORE_MISSING_DIMKEYS=TERSE | VERBOSEspecifying this option when building a cube from a star schema causes SAS toignore an error condition, log the error, and continue building the cube. The errorcondition is detected when the fact table contains foreign key values that are notpresent in one of the contributing dimension tables. By default, and when thisoption is not specified, any missing dimension keys stop the build of the cube.When IGNORE_MISSING_DIMKEYS=TERSE is specified, the cube buildcontinues and the fact table row with the missing key is ignored (it is not builtinto the cube). The SAS log receives an entry that lists the total number of keyvalues that are missing from each dimension table. Specifying a value ofVERBOSE produces the same behavior, except that the log receives additionaldetails; the missing keys are listed for each dimension table.

Page 91: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options 83

INDEX | NOINDEXspecifies whether or not to create the aggregations with indexes. For faster cubecreation and adding and deleting aggregations, you can set this option toNOINDEX; however, the lack of indexes will adversely affect query performance.

Note: This option applies to the automatically created NWAY and allaggregations that do not explicitly specify an INDEX option in theAGGREGATION statement. �Default: INDEX

INDEXPATH=(’pathname’ ...’pathnameN’)specifies the locations of the index component files that correspond to eachaggregation table partition as specified by the DATAPATH= option.

Note: This option applies to the automatically created NWAY and allaggregations that do not explicitly specify an INDEXPATH= option in theAGGREGATION statement. �

Note: Indexes are not created for aggregations that have fewer than 1,024records. �Default: The cube subdirectory of the location that is specified by the PATH=

option in the PROC OLAP statement

INDEXSORTSIZE=nspecifies the amount of memory in megabytes that is available when aggregationsare being created.Default: The system’s available memoryTip: So that each built index has a fair share of the assigned INDEXSORTSIZE

memory, INDEXSORTSIZE is divided by the CONCURRENT value. The valueof INDEXSORTSIZE should give each concurrent index build enough memory toat least hold a table PARTSIZE. For best performance, INDEXSORTSIZEdivided by CONCURRENT should be greater than PARTSIZE.

MAXTHREADS=nspecifies the maximum number of threads that are used to asynchronously createthe aggregation indexes. The processing engine calculates how many threads areneeded based on the number of indexes that are being created and theINDEXSORTSIZE= value. This option sets a limit on the number of threadsregardless of the number that is calculated by the processing engine. However, ifthe processing engine determines that fewer than the maximum number ofthreads is needed, then only the calculated number of threads are used.Default: The value of the SAS system option SPDEMAXTHREADS or 0. If the

value is 0, then the processing engine determines the number of threads basedon the number of indexes that are created plus the available memory. Themaximum value is 65,536 threads.

NO_NWAYprevents PROC OLAP from automatically creating an NWAY aggregation (thecrossing of all dimension levels) for the new cube. The automatically createdNWAY is usually the largest in the cube and most resembles the content of theunsummarized data source.Interaction: If you use this option, then the input data source that is specified

with the DATA= or FACT= option must be available at run time; otherwise,queries that are not covered by other aggregations will fail.

PARTSIZE=partition-sizespecifies the partition size in megabytes of the aggregation table partitions andtheir corresponding index components.

Page 92: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

84 Options � Appendix 1

Note: This option applies to the automatically created NWAY and allaggregations that do not explicitly specify a PARTSIZE= option in theAGGREGATION statement. �

Default: 128 megabytes. The minimum value is 16 megabytes.

PATH=’pathname’specifies the physical or logical path to the location of a new cube. Within thespecified path, the cube is stored in a directory that uses the name of the cube inuppercase letters. For example, if you enter the path’c:\v9cubes’ and the cubename is MrktData, then the cube is stored in ’c:\v9cubes\MRKTDATA’. Enclosethe path within quotation marks.

REGISTER_ONLYspecifies that metadata for a cube is to be registered, but the cube is not to bephysically built. All of the metadata for the cube is added to the SAS MetadataRepository. The physical cube can be built later using the existing metadatadefinition, as specified in Building a Cube from an Existing Definition in the helpfor SAS OLAP Cube Studio. Note that all data sets must physically exist atregistration time. The data sets can be empty—they do not need to contain data.Complete data sets are required when the cube is physically built.

SEGSIZE=rows-per-segmentspecifies the number of observations (table rows) in the file segment of the indexcomponent. The value is expressed in multiples of 1,024. The minimum value is 1(1,024 rows). The segmented indexes are used to optimize the processing ofWHERE expressions. Each parallel thread is given a segment of the table toevaluate that is equal to the value of the SEGSIZE= option multiplied by 1,024.

Note: This option applies to the NWAY aggregation and all aggregations thatdo not explicitly specify a SEGSIZE= option in the AGGREGATION statement. �

Default: 8 (8 x 1,024 = 8,192 rows)

SYNCHRONIZE_LEVELSchecks for SAS column name changes and cube level name changes in an existingcube. This option will find the name differences and change the level names tomatch the column names. When the SYNCHRONIZE_LEVELS option is set, onlythe METASVR statement is allowed. No other option or statement can be used.

Note: All source and aggregation column names for a level must be the same. �

WORKPATH=(’pathname1’ ...’pathnameN’)specifies one or more locations for temporary work files.

Default: For all operating environments except z/OS and VMS, if theWORKPATH= option is not specified, PROC OLAP uses the SPDEUTILLOC=system option. If SPDEUTILLOC= is not specified, PROC OLAP uses theUTILLOC= system option. If UTILLOC= is not specified, or if you do not havewrite access to the specified path, the follow message is generated:

ERROR: Cannot create temporary index for proc olap.NOTE: The SAS System stopped processing this stepbecause of errors.

For z/OS and VMS, PROC OLAP uses the SPDEUTILLOC= system option only.

Note: The SPDE options are honored by PROC OLAP only if theREGISTER_ONLY option is set on the PROC OLAP statement, and only if thelong form of the procedure is used to build a cube. The long form of the procedureis used when you run a SAS program that contains PROC OLAP code. The shortform of the procedure is used by SAS OLAP Cube Studio. �

Page 93: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options 85

METASVR Statement

The METASVR statement identifies the SAS metadata repository in which existingcube metadata information exists or in which metadata about a new cube is stored.

METASVR OLAP_SCHEMA=’schema-name’ < option(s)>;

The METASVR statement options can be used to override the metadata repositoryconnection values that are specified through SAS start-up options.

Note: During an interactive SAS session, if connection information is not availableeither through start-up settings or through a METASVR statement, then the user isprompted for the missing information. For more information about SAS start-upoptions, see SAS Language Reference: Dictionary. �

Following is an example of a METASVR statement with all of its options set:

metasvr olap_schema=’Banking Schema’repository=’financial repository’host=’misdept.us.mar.com’port=9999protocol=bridgeuserid=jjonespw=’my password’;

Required ArgumentOLAP_SCHEMA=’schema-name’

is a string that specifies the name of the schema that has been defined in a SASmetadata repository. The name can be a maximum of 32 characters. The OLAPschema specifies which group of cubes that a SAS OLAP Server can access. EachOLAP schema can be accessed by multiple SAS OLAP Servers; however, each SASOLAP Server has access to only one OLAP schema. When using embedded blanksor special characters in the schema name, enclose the name in quotation marks.

OptionsHOST=’metadata-server-host-name’

is a string that specifies the IP address of the metadata repository host. Anexample is ’misdept.us.mar.com’. The address can be a maximum of 256characters. When using lowercase letters, embedded blanks, or special charactersin the host name, enclose the name in quotation marks.

PORT=port-numberspecifies the numeric value of the port on which the metadata repository resides.

PROTOCOL=BRIDGE | COMspecifies the protocol that is used to connect to the specified metadata repository.

PW=’password’is a string that specifies the password for the user identified with the USERID=option. The password can be a maximum of 512 characters. When using lowercaseletters, embedded blanks, or special characters in the password, enclose thepassword in quotation marks.

Page 94: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

86 DIMENSION Statement � Appendix 1

REPOSITORY=’repos-name’is a string that specifies the name of a SAS metadata repository in which existingcube metadata information exists or in which metadata about a new cube isstored. The name can be a maximum of 60 characters. When using lowercaseletters, embedded blanks, or special characters in the repository name, enclose thename in quotation marks.

USERID=’userid’is a string that specifies the user’s identification for the specified metadatarepository. The identification can be a maximum of 256 characters. When usinglowercase letters, embedded blanks, or special characters in the user ID, enclosethe user ID in quotation marks.

DIMENSION Statement

The DIMENSION statement defines the logical and hierarchical relationshipsbetween the variables in the input data.

DIMENSION dim-name HIERARCHIES=(hier–nam ... hier-nameN) <option(s)>;

At least one DIMENSION statement must be specified when the cube is created. TheDIMENSION statement is not used when adding or deleting aggregations from cubes.

The maximum number of dimensions that can be defined in a cube is determined bycombining the number of dimensions with the number of multiple hierarchies that aredefined in those dimensions. The maximum value of that sum is 128. Mathematically,the sum is expressed as follows:

MaxDims = NumDims + NumMultipleHeirarchies = 128

All hierarchies other than the first hierarchy in each dimension apply to the total.Here are some examples of cubes that are defined with the maximum number of

dimensions:

128 dimensions, each dimension has 1 hierarchy

127 dimensions, 1 dimension has 2 hierarchies

126 dimensions, 1 dimension has 3 hierarchies

126 dimensions, 2 dimensions have 2 hierarchies

The DIMENSION statement does not create aggregations. To create aggregations,use the AGGREGATION statement.

A DIMENSION statement must include the name of at least one hierarchy in itsHIERARCHIES= option. In addition, a HIERARCHY statement must include the nameof at least one level in its LEVELS= option. Note that you cannot use the same level inmore than one dimension.

You can use LEVEL statements to specify a time period for each level in a TIMEdimension. You can also use LEVEL statements to supply information such as alevel-specific sort order or a level description.

The following example uses one DIMENSION statement, two HIERARCHYstatements, and three optional LEVEL statements to define a fully specified dimension.In the example, the same levels are being used in different ways.

dimension timehierarchies=(Year_Months Year_Quarters);hierarchy Year_Months

levels=(year month day)

Page 95: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options 87

;hierarchy Year_Quarters

levels=(year quarter day);

level yeartype=yearcaption=’Year’;

level quartertype=quarterscaption=’Quarter’;

level monthtype=monthscaption=’Month’;

level daytype=dayscaption=’Day’;

Required Argumentsdim-name

names a dimension by using a valid SAS name up to 32 characters. For namingguidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.

HIERARCHIES=(hier-name...hier-nameN)specifies the name of one or more hierarchies as defined by HIERARCHYstatements.

OptionsCAPTION=’string’

specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the dimension. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.Default: dim-name

DESC | DESCRIPTION=’string’specifies any number of characters that can be used to create a meaningfuldescription of the dimension. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.Default: dim-name

DIMKEY=dimension-table-columnspecifies the name of the column in the dimension table that is specified in theDIMTBL= option. That column must contain values that correspond to fact keyvalues in the fact table and be a value that corresponds to a unique combination oflevel values in the fact table.

Page 96: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

88 Options � Appendix 1

Note: The corresponding fact key is specified with the FACTKEY= option. Thefact table is specified with the FACT= option in the PROC OLAP statement. �

For example, for a dimension that is composed of three levels—NAME, ADDRESS,and INCOME—a dimension key named CUSTOMER_ID might exist. In thisdimension, each unique value of CUSTOMER_ID corresponds to a uniquecombination of NAME, ADDRESS, and INCOME.

Table A1.3 Sample Dimension Data That Illustrates How Unique DIMKEY Values Correspond to UniqueCombinations of Level Values

CUSTOMER_ID NAME ADDRESS INCOME

1 Juan hostel 2000

2 Shelly apartment 2000

3 Paul house 25000

4 Makoto castle 250000000

DIMTBL=libname.memnamespecifies the valid, two-level SAS name for a dimension table in the star schemathat is specified with the FACT= option in the PROC OLAP statement. Thedimension table must contain one column for each dimension level name (specifiedwith the LEVELS= option in HIERARCHY statements) and one column for thedimension key. However, if the dimension key is also a level, then the dimensiontable needs to have only as many columns as there are levels in the dimension.Member metadata for the dimension is derived from the information in the levelcolumns of the dimension table.

You can also specify data set options with DIMTBL=. Options are stored withinthe cube and reapplied when the data is accessed at run time. For moreinformation, see “Data Set Options” in SAS Language Reference: Concepts.

Note: The fact table does not have to contain all of the members. However, thefact table cannot contain any members that are not described by the levelcolumns. �

Note: The same dimension tables can be used to load cubes that have some,but not all, dimensions in common. This means that it is possible for multiplecubes to share the same dimension data. �

Note: If you are building a cube that will contain multiple national languages,then replace the DIMTBL= option with DIMTABLELIBREF= andDIMTABLEMEMPREF= options. In addition, you must create aUSER_DEFINED_TRANSLATIONS statement. �

DIMTABLELIBREF=specifies the library for the data sets that exist, for this dimension, in eachlanguage that is specified by the USER_DEFINED_TRANSLATIONS statement.The library is associated with the dimension and not the language. You cannot putdifferent languages in different libraries, but you can put different dimensions indifferent libraries. This option is required if you are using the Multiple LanguageSupport capabilities of the SAS OLAP Server. It is also used in conjunction withthe DIMTABLEMEMPREF= option.

Note: If you are building a cube that will contain multiple national languages,then DIMTABLELIBREF= and DIMTABLEMEMPREF= are required instead ofDIMTBL=. �

Page 97: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � LEVEL Statement 89

DIMTABLEMEMPREF=specifies the member prefix for the translated dimension tables. The memberprefix is the prefix of the data set name. The suffix of the name is provided by theUSER_DEFINED_TRANSLATIONS statement. For example, if the member prefixis dealdim_ and the suffix is da_DK, then PROC OLAP looks for a data set nameddealdim_da_DK.sas7bdat in the library that is specified by theDIMTABLELIBREF= option. DIMTABLEMEMPREF= is required if you are usingthe Multiple Language Support capabilities of the SAS OLAP Server. It is used inconjunction with the DIMTABLELIBREF= option and theUSER_DEFINED_TRANSLATIONS statement. This option follows the “NamingGuidelines for SAS OLAP Server” on page 108.

Note: If you are building a cube that will contain multiple national languages,then DIMTABLELIBREF= and DIMTABLEMEMPREF= are required instead ofDIMTBL=. �

FACTKEY=fact-table-columnspecifies the name of the column in the fact table that corresponds to thedimension table column that is specified with the DIMKEY= option. The namedoes not have to match the DIMKEY name. Referring back to the previouslydiscussed example, the FACTKEY name could be CUST_NO even though theDIMKEY name is CUSTOMER_ID. However, even if the names are different, theunderlying data must match. For example, you must match numeric columns withnumeric columns and character columns with character columns. In addition, ifthe FACTKEY is a character column, then it must be the same length as theDIMKEY column. If the FACTKEY is a numeric column, then it is handled as adecimal precision number (rather than as an integer).

SORT_ORDER=ASCENDING | DESCENDING | ASCFORMATTED |DESFORMATTED | DSORDER

specifies a sort order for all levels in the dimension. Values that are returned fromqueries display in this order by default.Default: ASCENDINGInteraction: This setting is overridden if sort order is set in a LEVEL statement.Tip: To specify a sort order for each level within a dimension, set the

SORT_ORDER= option in each LEVEL statement. Values that are returnedfrom queries display in this order.

Note: The sort order can be changed at query time using the MDX ORDERfunctions.

TYPE=TIME | GEOidentifies the dimension as a TIME or GEO dimension. The GEO type is usedwhen defining ESRI map information for a cube.Requirement: You must set this option for a TIME or GEO dimension. TIME

and GEO are the only valid values for this option.Interaction: You can use LEVEL statements to specify the time period of each

level in the TIME dimension. Specifying TYPE=TIME also allows you to use theMDX time series functions during data query.

LEVEL StatementThe LEVEL statement provides additional information about a level specified with

the LEVELS= option in a HIERARCHY statement, and enables you to set options forragged hierarchies.

Page 98: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

90 Required Arguments � Appendix 1

LEVEL level-name <option(s)>;

For TIME dimensions, you can use LEVEL statements to specify a time period foreach level in the dimension. However, if you specify the time period for one level, thenyou must specify the time period for all levels. You also use LEVEL statements tosupply information such as a level description or a level-specific sort order. You canhave a maximum of 256 levels per cube and a maximum of 19 levels per hierarchy.

Note: Levels that are shared between hierarchies share the values of the optionsEMPTY_CHAR=, EMPTY_NUM=, EMPTY=, and IGNORE_EMPTY. These options areused to create ragged or unbalanced heirarchies, as described in “Defining Ragged andUnbalanced Hierarchies with PROC OLAP” on page 17. �

Note: Levels use formats as specified in the input data source. To override theformat, you can use a SAS FORMAT statement. �

Note: When you rebuild a cube that has been physically deleted, the rebuilt cubestill uses the formats that were originally used to build the cube and were saved in thecube’s metadata. This means that the rebuilt cube does not automatically include anyformatting changes that you might have made in the input data source. To manuallyspecify the new formats, edit and rebuild the cube by using SAS OLAP Cube Studio. �

Required Argumentslevel-name

specifies a valid SAS name for the level that matches the name of a correspondingcolumn in the input data. (You can use a column as a level even if it is also beingused as a measure.) This is the same name that is used in the LEVELS= option inthe HIERARCHY statement. Level names must be unique within a cube. Fornaming guidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.

OptionsCAPTION=’string’

specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the level. Third-party applications that report on cube data mightdisplay this description. If the text includes blank spaces or special charactersthat are not permitted in a valid SAS name, then enclose the caption withinquotation marks.Default: The column’s label in the input data source. If there is no label

available, the default is the level name.

DESC | DESCRIPTION=’string’specifies any number of characters that can be used to create a meaningfuldescription of the level. Third-party applications that report on cube data mightdisplay this description. If the text includes blank spaces or any characters thatare not permitted in a valid SAS name, then enclose the text within quotationmarks.Default: The value of the CAPTION= option if one exists; otherwise, the

column’s label. If there is no label available, the default is the level name.

EMPTY=‘string’specifies the text string that identifies members that are to be skipped ordisregarded. Members are skipped in order to create ragged or unbalancedhierarchies, as described in “Defining Ragged and Unbalanced Hierarchies withPROC OLAP” on page 17.

Page 99: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � PROPERTY Statement 91

To be skipped, a member must have a caption whose value matches the value ofthe EMPTY= option. For example, if a member is skipped, and if the caption ofthat member is Empty, then the EMPTY= option is specified as follows:

empty=’Empty’

The maximum length of the quoted string is 256 characters.Interaction: The EMPTY= option overrides for that level any specification of

EMPTY_CHAR=, EMPTY_NUM=, or IGNORE_EMPTY that might have beenspecified in the respective HIERARCHY or PROC OLAP statement.See also “Naming Guidelines for SAS OLAP Server” on page 108.

IGNORE_EMPTYspecifies that any value of the EMPTY_CHAR= option (for character levels) orEMPTY_NUM= option (for numeric levels) that was specified in the respectiveHIERARCHY or PROC OLAP statement is to be ignored. The level is not to beskipped in the cube build. For further information, see “Defining Ragged andUnbalanced Hierarchies with PROC OLAP” on page 17.

SORT_ORDER=ASCENDING | DESCENDING | ASCFORMATTED |DESFORMATTED | DSORDER

specifies a sort order for a level within a dimension. Values that are returned fromqueries display in this order.Default: If a sort order is not specified in the DIMENSION statement or in the

LEVEL statement, then the default order of ASCENDING is applied.Interaction: This setting overrides the SORT_ORDER= setting in the

DIMENSION statement.

TYPE=YEAR | HALF_YEARS | QUARTERS | MONTHS | WEEKS | DAYS |HOURS | MINUTES | SECONDS

if you specify the TYPE=TIME option in the DIMENSION statement, then you canuse this LEVEL statement option to specify the time period for the dimensionlevels.Requirement: If you specify a time period for one level in the TIME dimension,

then you must specify the time period for all levels in the dimension. Withregard to drill path, identify the levels from the most general time period to themost specific.

PROPERTY StatementThe PROPERTY statement assigns properties to specific levels within specified

hierarchies.

PROPERTY prop-name LEVEL=level-name <option(s)>;

Each level can have more than one property assigned to it by using multiplePROPERTY statements. Property names must match the name of a column in theinput data source, or you must use the COLUMN= option to specify the column name.

In the following example, the COLUMN= option is used in the first two PROPERTYstatements because the column name is different from the property name. In this way,the property named Population can be assigned to both the country level and thestate level in the geo hierarchy. The level state has two properties: Populationand West_of_Miss.

property Populationcolumn=p_country

Page 100: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

92 Required Arguments � Appendix 1

hierarchy=geolevel=country;

property Populationcolumn=p_statehierarchy=geolevel=state;

property West_of_Misshierarchy=geolevel=state;

Required Argumentsprop-name

specifies a valid SAS name for the property. Usually this is the name of a columnin the input data source. If it is not the name of a column, then you must includethe COLUMN= option to specify the column name. For naming guidelines, see“Naming Guidelines for SAS OLAP Server” on page 108.

LEVEL=level-namespecifies the name of the level that you are assigning the property to.

OptionsCAPTION=’string’

specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the level. Third-party applications that report on cube data mightdisplay this description. If the caption includes blank spaces or special charactersthat are not permitted in a valid SAS name, then enclose the caption withinquotation marks.

Default: The column’s label if it exists, otherwise the property name.

COLUMN=column-namespecifies the name of a column from the input data source. You must use thisoption if the column name is not the same as the property name.

DESC | DESCRIPTION=’string’specifies any number of characters that can be used to create a meaningfuldescription of the level. Third-party applications that report on cube data mightdisplay this description. If the description includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.

Default: The value of the CAPTION= option if one exists; otherwise, thecolumn’s label.

HIERARCHY=(hier-name ... hier-nameN)specifies the name of one or more hierarchies that contain the level. If you do notinclude the HIERARCHY option, then the property is automatically assigned to alloccurrences of the level in all of the hierarchies in which it appears; otherwise, theproperty is assigned to the level only in the specified hierarchies.

Page 101: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Required Arguments 93

HIERARCHY StatementThe HIERARCHY statement specifies the navigational order of the levels in a

dimension.

HIERARCHY hier-name LEVELS=(level–name1 <level–name2 ...level-nameN>)<option(s)>;

You must define at least one hierarchy for each dimension. Specifically, eachDIMENSION statement must identify at least one unique HIERARCHY statement.

The maximum number of hierarchies that can be defined in a dimension isdetermined only by the maximum number of hierarchies that can be defined in a cube.The maximum number of hierarchies that can be defined in a cube is determined bycombining the number of multiple hierarchies with the number of dimensions. Themaximum value of that sum is 128. Mathematically, the sum is expressed as follows:

MaxHiers = NumMultHiers + NumDimensions = 128

All hierarchies other than the first hierarchy in each dimension apply to the total.Here are some examples of cubes that meet the maximum number of hierarchies:128 dimensions, each dimension has 1 hierarchy127 dimensions, 1 dimension has 2 hierarchies126 dimensions, 1 dimension has 3 hierarchies126 dimensions, 2 dimensions have 2 hierarchies

Levels in the same dimension can be shared between hierarchies. Every level in adimension must be assigned to a hierarchy in the dimension. You can have a maximumof 19 levels per hierarchy. There is no limit to the number of hierarchies per dimension.

Following is an example of a HIERARCHY statement that specifies three levels:

hierarchy Geographylevels=(country region division);

Required Argumentshier-name

specifies a valid SAS name for the hierarchy. This name is also used in theHIERARCHIES= option in the DIMENSION statement. The hier-name cannot bethe same as any of its level names. Hierarchy names must be unique within thecube. If the hierarchy that you are defining is the only one in the dimension, thenthe hierarchy name must match the dimension name. For other namingguidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.

LEVELS=(level-name1 <level-name2 ...level-nameN>)specifies a valid SAS name for at least one level. These names correspond tocolumns in your input data and are used in any optional LEVEL statements.Level names must be unique within a cube and cannot be the same as thehier-name. (You can use a column as a level even if it is also being used as ameasure.) Enter one or more names, separated by a space. Enter the level namesin the order in which you want them to be used, beginning with the top level. Fornaming guidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.Requirement: If the hierarchy is part of a TIME dimension, then the levels

must be listed in order from most general to least general based on theirassigned TYPE. For example, a TYPE=YEAR level must be listed before aTYPE=QUARTER level.

Page 102: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

94 Options � Appendix 1

OptionsCAPTION=’string’

specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the hierarchy. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.

Default: hier-name

DEFAULTidentifies a hierarchy as the default hierarchy for the dimension that is defined bythe DIMENSION statement.

Default: The first hierarchy listed for the dimension

DESC | DESCRIPTION=’string’specifies any number of characters that can be used to create a meaningfuldescription of the hierarchy. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.Default: the hierarchy caption, which may be the default, hier-name.

EMPTY_CHAR=’string’specifies the text string that identifies members of character levels that are to beskipped or disregarded. Members are skipped in order to create ragged orunbalanced hierarchies, as described in “Defining Ragged and UnbalancedHierarchies with PROC OLAP” on page 17.

To be skipped, a member in a character level must have a caption whose valuematches the value of the EMPTY_CHAR= option. For example, if a member in acharacter level is skipped, and if the caption of that member is Empty, then theEMPTY_CHAR= option is specified as follows:

empty_char=’Empty’

The maximum length of the quoted string is 256 characters.

Interaction: When specified in the HIERARCHY statement, theEMPTY_CHAR= option overrides (for that hierarchy) any specification of theEMPTY_CHAR= option in the PROC OLAP statement. In turn, theEMPTY_CHAR= option in the HIERARCHY statement is overridden by theEMPTY= or IGNORE_EMPTY options in the LEVEL statements in thathierarchy.To skip members in numeric levels, use the EMPTY_NUM= option.See also “Naming Guidelines for SAS OLAP Server” on page 108.

EMPTY_NUM=‘string’specifies the text string that identifies members of numeric levels that are to beskipped or disregarded. Members are skipped in order to create ragged orunbalanced hierarchies, as described in “Defining Ragged and UnbalancedHierarchies with PROC OLAP” on page 17.

To be skipped, a member in a numeric level must have a caption whose valuematches the value of the EMPTY_NUM= option. For example, if a member in anumeric level is skipped, and if the caption of that member is Empty, then theEMPTY_NUM= option is specified as follows:

empty_num=’Empty’

Page 103: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Required Arguments 95

The maximum length of the quoted string is 256 characters.

Interaction: When specified in the HIERARCHY statement, the EMPTY_NUM=option overrides (for that hierarchy) any specification of the EMPTY_NUM=option in the PROC OLAP statement. In turn, the EMPTY_NUM= option in theHIERARCHY statement is overridden by the EMPTY= or IGNORE_EMPTYoptions in the LEVEL statements in that hierarchy.

Note: If there is no format that is associated with the member value, thenBEST12 is used as the format. �

To skip members in character levels, use the EMPTY_CHAR= option.See also “Naming Guidelines for SAS OLAP Server” on page 108.

IGNORE_EMPTYspecifies that, for this hierarchy, any values that were specified for theEMPTY_CHAR= and EMPTY_NUM= options in the PROC OLAP statement are tobe ignored. This option can be overridden by specifications of EMPTY_CHAR= andEMPTY_NUM= in the same HIERARCHY statement. The IGNORE_EMPTYoption can also be overridden in subsequent LEVEL statements using theEMPTY= option. For further information, see “Defining Ragged and UnbalancedHierarchies with PROC OLAP” on page 17.

MEASURE StatementThe MEASURE statement defines the cube’s measures and indicates how they map

to the input data.

MEASURE measure-name STAT=statname <option(s)>;

Include one MEASURE statement for each measure in the cube. Each cube musthave at least one measure. Measure names must be unique. You can have a maximumof 1,024 measures per cube.

Note: All cube aggregations have identical measures. �

Required Argumentsmeasure-name

specifies a valid SAS name for the measure. The name must be unique. Fornaming guidelines, see “Naming Guidelines for SAS OLAP Server” on page 108.

STAT= statnamespecifies the statistic for the measure. The following base statistics are available:N, NMISS, NUNIQUE, SUM, MAX, MIN, or USS. In addition, these derivedstatistics are also available: AVG, RANGE, CSS, VAR, STD, STDERR, CV, T, PRT,LCLM, or UCLM.

When specifying the NUNIQUE statistic with the MDXfunctionDISTINCTCOUNT, it will return empty data when there is not a valid crossing ofdata. This can be removed when the axis uses non-empty. In addition, theNUNIQUE statistic will not be supported for cubes that contain ragged orunballanced hierarchies.

Note: At least one non-NUNIQUE measure must be defined. �New cubes that are based on a data source that contains existing summarized

data (where such data has been indicated in at least one AGGREGATIONstatement via the TABLE= option), must include measure statements for the

Page 104: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

96 Required Arguments � Appendix 1

stored statistics required for each derived statistic that you want to create for thenew cube. For example, if you want to calculate AVG, you must create measuresfor N and SUM, as well as AVG.

Note: MOLAP aggregations do not require the N and SUM. �The following table indicates which stored statistics are required for each

derived statistic:

Table A1.4 Stored Statistics Required for Each Derived Statistic

Derived Statistics Required Stored Statistics

AVG N, SUM

CSS N, SUM, USS

RANGE MIN, MAX

VAR, STD, STDERR, CV, T,PRT, LCLM, UCLM

N, SUM, USS

Note: For information about statistic formulas, see “Keywords and Formulas”in Base SAS Procedures Guide. �

For cubes that are not loaded from a fully summarized data source (that is, youspecified a data source by using the DATA | FACT= option), some statistics useformats taken from the input data source. Specifically, if the statistic is SUM, MIN,MAX, RANGE, AVG, STD, STDERR, LCLM, or UCLM, then PROC OLAP uses theformat that is assigned to the column specified by the COLUMN | ANALYSIS=option. The following table lists the formats used for the other supported statistics:

Table A1.5 Default Formats Used for Statistics

Statistic Format Used

CSS BEST.

CV 8.2

N 12.0

NMISS 10.0

PRT 6.4

T 7.3

USS BEST.

VAR BEST.

For cubes that are loaded from a fully summarized data source (that is, youspecified the data source by using the AGGREGATION statement), the defaultformat is BEST12.

To override the default formats, you can either set the FORMAT= option or usea SAS FORMAT statement.

Note: The FORMAT= option also overrides a FORMAT statement. �

Note: When you rebuild a cube that has been physically deleted, the rebuiltcube still uses the formats originally saved in the cube’s metadata. This meansthat the rebuilt cube does not automatically include any formatting changes thatyou might have made in the input data source. To manually specify the newformats, edit and rebuild the cube by using SAS OLAP Cube Studio. �

Page 105: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Required Arguments 97

COLUMN | ANALYSIS=anlvarspecifies the name of a numeric column that is contained in the cube’s input datasource. (You can use a column as a measure even if it is also being used as a level.)

If the cube is based on an unsummarized data source, then anlvar is the nameof the column in that data source from which the measure will be calculated. UseCOLUMN= to specify the column.

If the cube is based on a summarized data source, then anlvar can be the nameof the numeric column in the data source that was used as the analysis variablefor the pre-calculated measure. Use ANALYSIS= to specify the column. It can alsobe a name that identifies a logical association between measures with the sameanlvar name.

For example, if your cube has three measures, N, SUM, and AVERAGE, and ifthose measures were derived from the same analysis variable, then you couldspecify ANALYSIS=Sales to logically link the three measures through their sharedanalysis variable. You would also identify the analysis variable in theAGGR_COLUMN= option.

As a further illustration, assume that you were building a cube with an NWAYaggregation that was specified using a summarized SAS dataset. The datasetcontains the columns Country, Region, Division, Year, Quarter, Month,SumOfSales, and NumOfSales. You would use two MEASURES statements, onefor SumOfSales and another for NumOfSales, as follows.

measure Sales_Sumstat=sumaggr_column="SumOfSales"analysis="Sales"desc=’Sum of Sales’units=’Dollars’format=dollar10.2;

measure Sales_Nstat=naggr_column="NumOfSales"analysis="Sales"desc=’Number of Sales’units=’Dollars’format=dollar10.2;

The Sales column becomes logically linked with the physical columnsSumOfSales and NumOfSales.

If the cube consists of a combination of summarized and unsummarized datasources, then anlvar refers to both a physical and a logical entity. For example,you might have a cube that requires a physical analysis variable to create acrossing but that same cube already contains other, higher level aggregations. Inthis case, the analysis variable is also used to logically link the measures in thepre-existing aggregations that were derived from the same input column. Youwould also identify the analysis variable in the AGGR_COLUMN= option.

Default: measure-name

Interaction: An unsummarized data source is specified with the DATA | FACT=option in the PROC OLAP statement. A summarized data source is specifiedwith the TABLE= option in an AGGREGATION statement.

Note: The COLUMN argument is not required for the NUNIQUE statistic and willbe ignored for the NUNIQUE statistic if specified. �

Page 106: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

98 Options � Appendix 1

OptionsAGGR_COLUMN=input-column

specifies the name of the numeric column in the summarized input data thatcontains the values for the measure. The source of the summarized input data isspecified in the AGGREGATION statement. This option is valid only for storedstatistics.Default: measure-name

CAPTION=’string’specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the measure. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.Default: The default is based on the statistic and the COLUMN= value, as

shown in the following table. For example, if the statistic is SUM and theCOLUMN= value is Sales, then the default caption is Sum of Sales.

Table A1.6 Defaults for the CAPTION= Option If No Caption Is Specified

Statistic Used for Measure Default Caption

AVG Average measure-column-name

CSS Corrected Sum of Squares ofmeasure-column-name

CV Measure-column-name Coefficient ofVariation

LCLM Measure-column-name Lower ConfidenceLimit

MAX Maximum measure-column-name

MIN Minimum measure-column-name

N Number of Values for measure-column-name

NMISS Number of Missing Values formeasure-column-name

NUNIQUE Number of Unique Values for level-name inhierarchy-name

PRT Probability of Greater Absolute Value formeasure-column-name

RANGE Measure-column-name Range

STD Measure-column-name Standard Deviation

STDERR Measure-column-name Standard Error ofMean

SUM Sum of measure-column-name

T Measure-column-name T Value

UCLM Measure-column-name Upper ConfidenceLimit

Page 107: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � AGGREGATION Statement 99

Statistic Used for Measure Default Caption

USS Measure-column-name Uncorrected Sum ofSquares

VAR Measure-column-name Variance

DEFAULTidentifies a measure as the default measure for the cube.

Default: The measure defined in the first MEASURE statement

DESC | DESCRIPTION=’string’specifies any number of characters that can be used to create a meaningfuldescription of the measure. Third-party applications that report on cube datamight display this description. If the text includes blank spaces or any charactersthat are not permitted in a valid SAS name, then enclose the text within quotationmarks.

Default: measure-name

FORMAT=sas-format-namespecifies the SAS format to be used to display the value of the measure. Thisformat overrides the default format (see STAT= for more information) and anyformat that is specified in a SAS FORMAT statement.

Note: When you rebuild a cube that has been physically deleted, the rebuiltcube still uses the formats that were originally saved in the cube’s metadata. Thismeans that the rebuilt cube does not automatically include any formattingchanges that you might have made in the input data source. To manually specifythe new formats, edit and rebuild the cube by using SAS OLAP Cube Studio. �

HIERARCHY=’string’specifies the hierarchy in which the level resides. This option is used only with theNUNIQUE statistic. If there is only one hierarchy, then the option may be omitted.

Note: The HIERARCHY= option will be ignored for non-NUNIQUE statistics ifspecified. �

LEVEL= ’string’specifies the level for which a unique count will be determined. This option is usedonly with the NUNIQUE statistic. The default is the Measure name.

Note: The LEVEL= option will be ignored for non-NUNIQUE statistics ifspecified. �

UNITS=’string’specifies a maximum of 256 characters that can be used to create a meaningfuldescription of the measure’s units (for example, “pounds sterling”). Third-partyapplications that report on cube data might display this description. If the textincludes blank spaces, mixed-case letters, special characters, then enclose the textwithin quotation marks.

AGGREGATION StatementThe AGGREGATION statement defines an aggregation of the cube based on level

information that you provide.

AGGREGATION level-name <level-name2 level-name3 ...level-nameN> / <option(s)>;

Page 108: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

100 Required Arguments � Appendix 1

You can specify level names that are associated with an unsummarized data source,or you can specify level names that match columns in a table that contains existingaggregated data. The levels can exist in more than one dimension. You do not need toinclude dimension names because level names must be unique across dimensions.

Here is an example of an AGGREGATION statement that specifies three levels anduses the NAME= option. The slash character ( / )is required to separate level namesfrom option specifications.

aggregation country prodtype year /name=’Product Types by Country’;

Required Argumentslevel-name

is the level that is to be used to create the aggregation. Additional level names areoptional. Names are separated by spaces. Names are separated from optionspecifications with a required slash character ( / ). You do not have to include alllevels that are specified in all HIERARCHY statements, but the names that youdo specify must match the names that are used in the HIERARCHY statements.You can include a TABLE= option to identify a table that contains existingaggregated information for your specified levels. The levels that you specify mustmatch columns in the input table.Restriction: Levels must be listed in drill-path order. You cannot specify an

aggregation that contains a summary level that could never be requested. Forexample, if your TIME hierarchy contains the levels Year, Month, and Day, youcould specify Year and Month as an aggregation but not Month by itself.

OptionsNote: For information about options that can be used to optimize cube creation and

query performance, see “Options Used for Performance” on page 116Syntax OptionsUsed for Performance. �

COMPRESS | NOCOMPRESSspecifies whether or not to store the aggregation table in a compressed format ondisk.Default: NOCOMPRESS

DATAPATH=(’pathname’ ...’pathnameN’)specifies the location of one or more partitions in which to place aggregation tabledata. The data is distributed by cycling through each partition location accordingto the partition size. This is set by using the PARTSIZE= option. For example, ifyou specify DATAPATH=(’c:\data1’ ’d:\data2’), then PROC OLAP places thefirst partition of the aggregation table into directory c:\data1, the secondpartition of the table into directory d:\data2, the third partition of the table intoc:\data1, and so on. It is also possible to have aggregation tables that use fewerthan the specified number of partitions. For example, your aggregation tablemight fit entirely into c:\data1.Default: The cube subdirectory of the location that is specified by the PATH=

option in the PROC OLAP statement

INDEX | NOINDEXspecifies whether or not to create the specified aggregation with indexes. Forfaster cube creation and updates, you can set this option to NOINDEX; however,the lack of indexes might adversely affect query performance.

Page 109: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � DROP_AGGREGATION Statement 101

Note: Indexes are not created for aggregations that have fewer than 1,024records. �Default: INDEX

INDEXPATH=(’pathname’ ...’pathnameN’)specifies the locations of the index component files that correspond to eachaggregation table partition as specified by the DATAPATH= option.Default: The cube subdirectory of the location that is specified by the PATH=

option in the PROC OLAP statement

NAME=’aggregation-name’specifies a maximum of 256 characters as the name of the aggregation. If thename includes blank spaces or any characters that are not permitted in a validSAS name, then the name must be enclosed within quotation marks. The name isstored with the cube’s metadata.Default: A name assigned by SAS such as AGGR1.

PARTSIZE=partition-sizespecifies the partition size in megabytes of the aggregation table partitions andtheir corresponding index components.Default: 128 megabytes. The minimum value is 16.

SEGSIZE=rows-per-segmentspecifies the number of observations (table rows) in the file segment of the indexcomponent. The value is expressed in multiples of 1,024. The minimum value is 1(1,024 rows). The segmented indexes are used to optimize the processing ofWHERE expressions. Each parallel thread is given a segment of the table toevaluate that is equal to the value of the SEGSIZE= option multiplied by 1,024.Default: 8 (8 x 1,024 = 8,192 rows)Interaction: The value of this option overrides for the current aggregation any

such value that was specified for all aggregations in the PROC OLAP statement.

TABLE=libname.datasetspecifies the name of a SAS data set or data view that contains the data for oneaggregation. Every level that is listed in the AGGREGATION statement mustmatch a column that contains aggregation information in the specified table. Placethis option after the list of level names.

Analysis columns in the table are mapped to the numeric columns that arespecified with the AGGR_COLUMN= option in MEASURE statements.

You can also set data set options with TABLE=. Options are stored within thecube and reapplied when the data is accessed at run time. For more information,see “Data Set Options” in SAS Language Reference: Concepts.Restriction: You cannot use the TABLE= option in an AGGREGATION

statement that is used to add an aggregation to an existing cube.

DROP_AGGREGATION StatementThe DROP_AGGREGATION statement removes an aggregation from the specified

cube.

DROP_AGGREGATION level-name1 < level-name2 ...level-nameN> /NAME=aggregation-name;

You can specify the levels that are in the aggregation, or the name of theaggregation, or both the levels and the name. The slash character ( / )is required toseparate level names from option specifications.

Page 110: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

102 Required Arguments � Appendix 1

Required ArgumentsAt least one of the following arguments is required for a DROP_AGGREGATION

statement:

level-name1specifies the names of the level that is in the aggregation that you want to drop.Additional levels can be specified using blank spaces to separate the level names,as shown in the following example.

drop_aggregation Year Month Product /name=Sales ;

NAME=’aggregation-name’specifies the name of the aggregation that you want to drop. If the name includesblank spaces or any characters that are not permitted in a valid SAS name, thenthe name must be enclosed within quotation marks.

DEFINE StatementThe DEFINE statement defines a global calculated member or a named set for any

cube that is registered in a SAS metadata repository.

DEFINE MEMBER | SET ’member-or-set-name’ AS ’mdx-expression’ ;

A calculated member is a dimension member that has been calculated from themember values in the input table. Only the definition of the member is stored; thevalue is calculated when a query is submitted. A named set is an alias for a specifiedMDX expression. Named sets are often used to make complex MDX queries easier toread and maintain.

The defined calculated members and named sets are available to any session thatcreates a query in the context of the SAS OLAP server and the schema defined in theMETASRV statement of the PROC OLAP code that is used to create the global memberor set.

DEFINE statements can apply to more than one cube, so the CUBE= option is notrequired to use this statement. The METASVR statement verifies that the cubedefinition exists in the metadata repository.

The DEFINE statement can be used alone as shown in this example, which definestwo calculated members and one named set. The METASVR is the only other requiredstatement. To define multiple sets or calculated members, separate option values with acomma.

proc olap;metasvr olap_schema=’Services Schema’

repository=’services’host=’misdept.us.mar.com’port=9999protocol=bridgeuserid=jjonespw=’my password’;

defne member ’[mddbcars].[Measures].[avg]’ as’[Measures].[sales_sum]/[Measures].[sales_n]’,

member ’[sales].[Measures].[stat1]’ as’[Measures].[qty] +1’,

Page 111: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � DEFINE Statement 103

set ’[campaign].[myset]’ as’[campaign_dates].[All campaign_dates].children’

;run;

The DEFINE statement can also be used with a PROC OLAP program that creates acube or with a program that adds aggregations to or deletes aggregations from anexisting cube. Cube builds, additions, and deletions occur before the DEFINE statementis processed, so the DEFINE statement is not processed if those statements fail.

proc olap data=olapsio.carscube=mddbcarspath=’d:\services\’;

metasvr olap_schema=’Services Schema’repository=’cars’host=’misdept.us.mar.com’port=9999protocol=bridgeuserid=jjonespw=’my password’;

dimensoion datehierarchies=(date)sort_order=scending;

hierarchy dateLEVELS=(dte);

level dte;

dimension carshierarchies=(carssort_order=ascending);

hierarchy carslevels=(car color);

dimension dealershierarchies=(dealers)sort_order=ascending;

hierarchy dealerslevels=(dealer dest);

measure sales_sumcolumn=salesstat=sumformat=dollar15.2;

measure sales_ncolumn=salesstat=nformat=12.0;

Page 112: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

104 Required Arguments � Appendix 1

define member ’[mddbcars].[Measures].[avg]’ as’[Measures].[sales_sum] / [Measures].[sales_n]’;

run;

Required ArgumentsMEMBER | SET

indicates whether you are creating a calculated member or a named set.

’member-or-set-name’specifies the name of the member or set that you are creating. If you are creatinga calculated member, then this value specifies a name for the member that will becalculated by the MDX expression. If you are creating a named set, then thisvalue is the alias for the specified MDX expression.

AS ’mdx-expression’specifies the MDX expression.

UNDEFINE StatementThe UNDEFINE statement deletes from a SAS metadata repository one or more

global calculated members or named sets.

UNDEFINE MEMBER | SET ‘member-or-set-name’ ;

To delete multiple calculated members or named sets in a single UNDEFINEstatement, use commas to separate instances of MEMBER | SET ‘member-or-set-name’.

For additional information on calculated members and named sets, see “DEFINEStatement” on page 102.

The following example shows how a single UNDEFINE statement can be used todelete from a metadata repository two calculated members and one named set.

proc olapl;metasvr olpa_schema=’Services Schema’

repository=’services’host=’misdept.us.mar.com’port=9999protocol=bridgeuserid=jjonespw=’my password’;

undefine member ’[carsCube].[Measures].[avg]’,member ’[sales].[Measures].[stat1]’,set ’[campaign].[myset]’;

run;

Page 113: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � USER_DEFINED_TRANSLATIONS Statement 105

Required ArgumentsMEMBER | SET

indicates whether you are deleting a global calculated member or a named set.

’member-or-set-name’specifies the name of the member or set that is to be deleted from the metadatarepository. Cube names and dimension names are required for eachmember-or-set-name. Square brackets ([, ])are optional inside the quotation marksof member-or-set-name, as shown in the preceding example.

USER_DEFINED_TRANSLATIONS Statement

The USER_DEFINED_TRANSLATIONS statement is required to use the MultipleLanguage Support capabilities of the SAS OLAP Server. This statement specifies thelocales that are associated with the data sets that you specify in the DIMENSIONstatement.

USER_DEFINED_TRANSLATIONS locale < locale2 ...localeN> ;

Note: Alternative statement names are UDT andUSER_DEFINED_TRANSLATION. �

PROC OLAP uses the UDT statement information, along with DIMENSIONstatement options, to read your alternate locale data sets and create locale-specificmetadata for use at query time. Query results are returned in the language of therequested locale. The Multiple Language Support feature is available only for cubesthat are loaded from a star schema. The alternate locale data set names consist of aprefix, which indicates the member, and a suffix, which indicates the language. TheDEFINE statement supplies the suffix. The DIMTABLEMEMPREF= option in theDIMENSION statement specifies the member prefix. For example, if the member prefixis dealdim_ and the suffix is pl_PL, then PROC OLAP looks for a data set nameddealdim_pl_PL.sas7bdat in the library that is specified by the DIMTABLELIBREF=option.

The following sample code looks for these dimension data sets in the mylib library.The default locale is the first locale specified in the UDT statement. Additionally, thedefault locale does not use the suffix that is defined by the UDT statement. In thisexample, Polish is the default locale, so the suffix is not used.

dimension datehierarchies=(date)sort_order=ascendingdimtablelibref=mylibdimtablemempref=ctimedim_factkey=dtedimkey=dte;

hierarchy date levels=(dte);

level dte;

dimension carshierarchies=(cars)sort_order=ascending

Page 114: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

106 Required Argument � Appendix 1

dimtablelibref=mylibdimtablemempref=cardim_factkey=carkeydimkey=carkey;

dimension carslevels=(car color);

dimension dealershierarchies=(dealers)sort_order=ascendngdimtablelibref=mylibdimtablemempref=dealdim_factkey=dealerkeydimkey=dealerkey;

hierarchy dealerslevels=(dealer dest);

user_defined_translationspl_PL /* Polish as used in Poland */en_US /* English as used in the United States */ja_JP /* Japanese as used in Japan */;

Table A1.7 Locales and Associated Data Set Names

Locale Dimension Data Sets

English ctimedim_en_US cardim_en_US dealdim_en_US

Japanese ctimedim_ja_JP cardim_ja_JP dealdim_ja_JP

Polish ctimedim_ cardim_ dealdim_

Required Argumentlocale

specifies the locales that correspond to the data sets contained in the library thatis specified by the DIMTABLELIBREF= option in the DIMENSION statement.Separate locales with a space.

SAS Servers and Character EncodingIf your server metadata contains characters other than those typically found in

English, then you must be careful to start your server with an ENCODING= orLOCALE= system option that accommodates those characters. For example, a SASserver started with the default US English locale cannot read metadata that containsJapanese characters. SAS will fail to start and will log a message indicating atranscoding failure.

In general, different SAS jobs or servers can run different encodings (such as ASCII/EBCDIC or various Asian DBCS encodings) as long as the encoding that is used by theparticular job or server can represent all the characters of the data being processed. Inthe context of server start up, this requires that you review the characters used in the

Page 115: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Tables Used to Define Cubes 107

metadata describing your server (as indicated by the SERVER= objectserverparm) toensure that SAS runs under an encoding that supports those characters.

Tables Used to Define CubesThere are five types of tables that can be used to define a cube:� detail tables� fact tables and dimension tables (for cubes that are based on star schemas)� aggregation tables� drill-through tables

Detail TablesA detail, or base, table is any table that is defined in a SAS metadata repository that

contains the columns for the measures and levels of a cube. A detail table consists ofunsummarized data that must include one column for each level and one numericanalysis column for each set of measures that will be generated.

Fact Tables and Dimension TablesA star schema refers to a set of input tables that are defined in a SAS metadata

repository. A set of tables includes a single fact table and one or more dimension tables.A fact table must contain one numeric analysis column for each set of measures thatwill be generated. For levels, a fact table will either contain the columns for the levelsof a dimension or contain a key column that links the fact table with a dimension tablethat contains the columns for the levels of a dimension.

The following statements are also true for star schemas:� A fact table can contain a dimension. When this occurs, all the level columns are

contained in the fact table and no fact or dimension key is required.� If the dimension levels are defined in a dimension table, then all the level columns

for that dimension must be contained in the same dimension table.� Both the dimension keys and the fact keys are single columns, not combinations of

columns.� The dimension key can also be a level in the dimension.

Aggregation TablesAggregation tables are fully summarized, external relational tables. All aggregation

tables must contain a column for each measure in the cube where the statistic for themeasure is one of the following: N, NMISS, SUM, MAX, MIN, or USS. Columns forderived measures cannot be stored on the aggregation table and are ignored if theyexist. Derived measures are always computed at query time. (See the STAT= option inthe MEASURE statement for more information about stored and derived statistics.)

An aggregation table can be used in two ways:� As an NWAY data source for the cube. In this case, the table must contain a

column for every level in the cube and a column for every stored measure.� As a subaggregation for the cube. In this case, the table must include a column for

each level of the aggregation and a column for every stored measure.

Drill-Through TablesDrill-through tables are views, data sets, or other data files maintained by the user

that represent all of the relevant input data that is used to define a cube. This data islater accessed when performing drill-through actions from a client. PROC OLAP checksthat the drill-through table has the correct level and measure names but never looks atthe actual data contents of the table. The name of the drill-through table is stored inthe cube’s metadata in place of a detail or fact table name. (The detail or fact table

Page 116: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

108 Naming Guidelines for SAS OLAP Server � Appendix 1

name is still referred to when an action is performed on a cube.) The drill-through tablename can be set either when the cube is first created or during an update.

Drill-through tables can be used by client applications to provide a view fromprocessed data into the underlying data source.

Naming Guidelines for SAS OLAP ServerFor SAS OLAP Server, names� can be up to 32 characters in length.� can contain mixed-case letters. SAS stores and writes the variable name in the

same case that is used in the first reference to the variable. However, when SASprocesses a variable name, SAS internally converts it to uppercase. You cannot,therefore, use the same variable name with a different combination of uppercaseand lowercase letters to represent different variables. For example, cat, Cat, andCAT all represent the same variable.

� can contain characters other than Latin alphabet letters, numerals, andunderscores, including embedded blanks. An exception to this is the dot character(.), which is an invalid character. You can do this by setting the SAS system optionVALIDVARNAME=ANY. When this is set, PROC OLAP interprets the name as aSAS name literal, which is a token that is expressed as a string within quotationmarks, followed by the letter n. Here are some examples:

dimesion ’Product@Work Dimension’nhierarchies=(’Product@Work Hierarchy’n);

hierarchy "Product@Work Hierarchy"nlevels=(prodtype product);

The PROC saves the case of the FIRST LOGICAL ENCOUNTER of an objectname in the PROC script and saves it as the final stored name in the cubemetadata. Therefore, the logical order of statement processing is as follows:

DIMENSIONHIERARCHYLEVELAGGREGATIONMEASUREPROPERTY.

Every DIMENSION statement is processed before any HIERARCHY statementand every HIERARCHY statement is processed before any LEVEL statement.This rule affects hierarchy and level names only. The stored hierarchy names arecopied from the DIMENSION statement and the stored level names are copiedfrom the first HIERARCHY statement listed in the PROC that uses this level.Here is an example:

hierarchy Timelevels=(Year Month Day);

dimension Timehierarchies=(Time);

level year

Page 117: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Loading Cubes from a Detail Table 109

type=year;

In this example the hierarchy name is stored in the cube as “Time” rather than“TimE”. The level name for year is stored as “Year” rather than “YEAR”. TheAGGREGATION statement does not affect the case of the level names that arestored in the cube metadata.

Note: For further information about the VALIDVARNAME= system option, see“VALIDVARNAME=System Option” and “Names in the SAS Language” in SASLanguage Reference: Dictionary. �

Loading Cubes

Loading Cubes from a Detail TableThe following table lists the PROC OLAP statements and options that you use to

load a cube from a detail table. The detail table has a column for each level and at leastone numeric analysis column from which one or more measures can be generated.

Table A1.8 Statements and Options Used for Loading Cubes from a Detail Table

Use these statements Use these options

AGGREGATION The AGGREGATION statement is optional unless you are creatingadditional aggregations, in which case, you must specify the names ofthe contiguous levels to be used to create the aggregation. Use theTABLE= option for cubes that are loaded from fully summarizedtables.

DIMENSION HIERARCHIES= Required

DESC= Optional

CAPTION= Optional

TYPE=TIME Required only for TIMEdimensions

SORT_ORDER= Optional

HIERARCHY LEVELS= Required

DESC= Optional

CAPTION= Optional

LEVEL DESC=

CAPTION=

TYPE=

The LEVEL statement is optional unless you want to specify timeperiods for each level in a TIME dimension. If you specify a timeperiod for one level, then you must specify a time period for all levels.To specify a time period, you use the TYPE= option.

MEASURE STAT= Required

COLUMN | ANALYSIS= Required

Page 118: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

110 Loading Cubes from a Star Schema � Appendix 1

Use these statements Use these options

AGGR_COLUMN Required if you use theAGGREGATION statement withthe TABLE= option

DESC= Optional

CAPTION= Optional

UNITS= Optional

FORMAT= Optional

DEFAULT= Optional

METASVR OLAP_SCHEMA= Required

REPOSITORY= Optional

HOST= Optional

PORT= Optional

PROTOCOL= Optional

USERID= Optional

PW= Optional

PROC OLAP DATA= Required

CUBE= Required

PATH= Required

DESC= Optional

NO_NWAY Optional

Loading Cubes from a Star SchemaThe following table lists the PROC OLAP statements and options that you use to

load a cube from a star schema. A star schema is a set of input tables that are definedin a repository. The set of tables includes a single fact table and one or more dimensiontables. The fact table must contain at least one numeric analysis column for each set ofmeasures that will be generated.

Table A1.9 Statements and Options Used to Load Cubes from a Star Schema

Use these statements Use these options

PROC OLAP FACT= Required

CUBE= Required

PATH= Required

DESC= Optional

NO_NWAY Optional

METASVR OLAP_SCHEMA= Required

REPOSITORY= Optional

HOST= Optional

Page 119: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Loading Cubes from a Star Schema 111

Use these statements Use these options

PORT= Optional

PROTOCOL= Optional

USERID= Optional

PW= Optional

DIMENSION HIERARCHIES= Required

DESC= Optional

CAPTION= Optional

TYPE=TIME Required only for TIMEdimensions

TYPE=GEO Required only for GEO (ESRIMap) dimensions

SORT_ORDER= Optional

DIMTBL= Required for cubes that supportone locale. If the cube willcontain multiple nationallanguages, replace this optionwith DIMTABLELIBREF= andDIMTABLEMEMPREF=.

DIMKEY= Required

FACTKEY= Required

DIMTABLELIBREF= Required if you are building acube that will contain multiplenational languages. ReplacesDIMTBL=.

DIMTABLEMEMPREF= Required if you are building acube that will contain multiplenational languages. ReplacesDIMTBL=.

LEVEL The LEVEL statement is optionalunless you want to specify timeperiods for each level in a TIMEdimension. If you specify a timeperiod for one level, then youmust specify a time period for alllevels. To specify a time period,you use the TYPE= option.

HIERARCHY LEVELS= Required

DESC= Optional

CAPTION= Optional

MEASURE STAT= Required

COLUMN | ANALYSIS= Required

AGGR_COLUMN= Required if you use theAGGREGATION statement withthe TABLE= option

Page 120: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

112 Loading Cubes Using Summarized Data � Appendix 1

Use these statements Use these options

DESC= Optional

CAPTION= Optional

UNITS= Optional

FORMAT= Optional

DEFAULT= Optional

AGGREGATION The AGGREGATION statementis optional unless you arecreating additional aggregations,in which case, you must specifythe names of the contiguouslevels to be used to create theaggregation. Use the TABLE=option for cubes that containaggregated data from tablesother than the input data source.

Loading Cubes Using Summarized Data

The following table lists the PROC OLAP statements and options that you use toload cubes from a fully summarized data source (a crossing of all dimensions alsoknown as an NWAY):

Table A1.10 Statements and Options Used to Load Cubes from Fully Summarized Data

Use these statements Use these options

PROC OLAP CUBE= Required

PATH= Required

DESC= Optional

METASVR OLAP_SCHEMA= Required

REPOSITORY= Optional

HOST= Optional

PORT= Optional

PROTOCOL= Optional

USERID= Optional

PW= Optional

DIMENSION HIERARCHIES= Required

DESC= Optional

CAPTION= Optional

TYPE=TIME Required only for TIMEdimensions

SORT_ORDER= Optional

Page 121: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Building a Cube from an Existing Definition 113

Use these statements Use these options

LEVEL The LEVEL statement is optionalunless you want to specify timeperiods for each level in a TIMEdimension. If you specify a timeperiod for one level, then youmust specify a time period for alllevels. To specify a time period,you use the TYPE= option.

HIERARCHY LEVELS= Required

DESC= Optional

CAPTION= Optional

MEASURE STAT= Required

COLUMN | ANALYSIS= Required

AGGR_COLUMN= Required

DESC= Optional

CAPTION= Optional

UNITS= Optional

FORMAT= Optional

DEFAULT= Optional

AGGREGATION names of the contiguous levels tobe used to create the aggregation

Required (additionalAGGREGATION statementswithout the TABLE= option canbe used to create aggregationsother than the automaticallydefined NWAY)

TABLE= Required

Maintaining Cubes

Building a Cube from an Existing DefinitionIt is possible to have cube definitions in the SAS metadata repository that do not

have associated physical cubes. For example, you can use the DELETE_PHYSICAL=option in the PROC OLAP statement to delete a cube but leave its definition intact. Youcan also use SAS OLAP Cube Studio to save only the definition of a new cube.

The following table lists the PROC OLAP statements and options that you use tobuild a cube from an existing metadata definition:

Page 122: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

114 Adding Aggregations to an Existing Cube � Appendix 1

Table A1.11 Statements and Options Used to Build a Cube from an Existing Definition

Use these statements Use these options

PROC OLAP CUBE=

METASVR OLAP_SCHEMA=

Adding Aggregations to an Existing CubeThe following table lists the PROC OLAP statements and options that you use to add

aggregations to an existing cube.

Table A1.12 Statements and Options Used to Add Aggregations to an Existing Cube

Use these statements Use these options

PROC OLAP CUBE= Required

METASVR OLAP_SCHEMA= Required

AGGREGATION Names of the contiguous levels tobe used to create the aggregation

Required

NAME= Optional

DATAPATH= Optional

INDEXPATH= Optional

COMPRESS | NOCOMPRESS Optional

INDEX | NOINDEX Optional

PARTSIZE= Optional

SEGSIZE= Optional

Note: You can add and delete aggregations in the same PROC OLAP script. �

Note: You cannot add aggregations to a cube that contains aggregated data from asource other than the input data source. �

Deleting Aggregations from an Existing CubeThe following table lists the PROC OLAP statements and options that you use to

delete aggregations from an existing cube.

Table A1.13 Statements and Options Used to Drop Aggregations from an Existing Cube

Use these statements Use these options

DROP_AGGREGATION Specify one or more level names that correspond tothe aggregations that you want to remove, or usethe aggregation name to specify the aggregationthat you want to remove.

METASVR OLAP_SCHEMA=

PROC OLAP CUBE=

Note: You can add and delete aggregations in the same PROC OLAP script. �

Page 123: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

PROC OLAP � Options for Managing Ragged Hierarchies 115

Note: You cannot delete aggregations from a cube that contains aggregated datafrom a source other than the input data source. �

Deleting CubesThe following table lists the PROC OLAP statements and options that you use to

delete existing cubes.If you use the DELETE option, then both the physical cube and its definition, which

is stored in the metadata server, are deleted.

Table A1.14 Statements and Options Used to Delete a Cube and Its Metadata

Use these statements Use these options

METASVR OLAP SCHEMA=

PROC OLAP CUBE=

DELETE

If you use the DELETE_PHYSICAL option, then only the physical cube is deleted;the definition remains intact.

Table A1.15 Statements and Options Used to Delete a Cube but Retain Its Metadata

Use these statements Use these options

METASVR OLAP_SCHEMA=

PROC OLAP CUBE=

DELETE_PHYSICAL

Specialized Options for PROC OLAP

Options for Managing Ragged HierarchiesIf a hierarchy is balanced, then all of its branches descend to the same level, and

each member has a parent level that is positioned immediately above it. However,hierarchies are not always balanced and sometimes they contain missing hierarchymembers. To manage missing hierarchy members, you can use these four options,which were created specifically for ragged hierarchies:

Table A1.16 Options That Can Be Set to Manage Missing Hierarchy Members in Ragged Hierarchies

These options Are available in these statements

EMPTY_CHAR= PROC OLAP and HIERARCHY

EMPTY_NUM= PROC OLAP and HIERARCHY

Page 124: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

116 Options Used for Performance � Appendix 1

These options Are available in these statements

EMPTY= LEVEL

IGNORE_EMPTY HIERARCHY and LEVEL

Options Used for PerformanceWhen you create a cube, you can set some options that can be used to optimize cube

creation and query performance. If you set the options in the PROC OLAP statement,then the settings are applied to all aggregations in the cube. If you set the options in theAGGREGATION statement, then the options apply to that specific aggregation. Optionsset for individual aggregations override any options set in the PROC OLAP statement.

The options are� COMPACT_NWAY� COMPRESS | NOCOMPRESS� CONCURRENT=� DATAPATH=� INDEXPATH=� INDEXSORTSIZE=� MAXTHREADS=� NOINDEX | INDEX� PARTSIZE=� SEGSIZE= .

Note: INDEXSORTSIZE=, MAXTHREADS=, and CONCURRENT= are availableonly on the PROC OLAP statement. �

For an explanation of these options, see the PROC OLAP statement and theAGGREGATION statement.

Page 125: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

117

A P P E N D I X

2SAS OLAP Cube Studio Messages

Cube Designer Error Messages 117Dimension Designer Error Messages 124

Specify Map Error Messages 127

Miscellaneous Error Messages 127

Cube Designer Error Messages

Table A2.1 Cube Designer Error Messages

Error Message Comment

An aggregation cannot be named Default.Please enter another name.

This message is received on the Generated orUser-Defined Aggregation pages. Rename theaggregation to a valid SAS name.

The map information is incorrect. To correct theinformation, select Yes and then display theSpecify Map page for the geographic dimension.Select No to remove all the map information.

This message is received on the Dimension pagewhen specifying GIS map information for adimension.

The GEO dimension was changed to aSTANDARD dimension and all map informationhas been removed.

This message is received on the Dimension pagewhen specifying GIS map information for adimension.

At least one dimension must be defined. This message is received on the Dimension page.You must define a dimension for the cube.

A problem was encountered reading the mapinformation.

This message is received on the Dimension pagewhen specifying GIS map information for adimension.

The <table name> table is used in a dimensionbut is not selected. Select OK to remove thedimension and aggregations created from thistable or Cancel so you can select the table.

This message is received on the DimensionTables page when removing the table associatedwith existing dimensions.

The <table name> tables are used in adimension but are not selected. Select OK toremove the dimension and aggregations createdfrom these tables or select Cancel so you canselect the tables.

This message is received on the DimensionTables page when removing more than one table.

Page 126: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

118 Cube Designer Error Messages � Appendix 2

Error Message Comment

One or more tables must be selected asDimension tables.

This message is received on the DimensionTables page when a dimension table is notselected.

The user-defined aggregation already exists. This message is received on the GeneratedAggregations page when the selected levelsmatch the levels in another aggregation.

The selected user-defined aggregation alreadyexists.

This message is received on the StoredAggregations page when the selected levelsmatch the levels in another aggregation.

<level name> level does not follow drill-pathorder.

This message is received on either theGenerated or User-Defined Aggregations page.The selected levels must match the drill order ofat least one hierarchy.

Member Property name already exists for thislevel and hierarchy

This message is received on the Define aMember Property page. Click OK on themessage and the duplicate member propertyname is checked. You must change the name forthis member property to a unique name.

The aggregation name already exists. This message is received on either theGenerated or User-Defined Aggregations page.You must enter a different aggregation name.

Changes to metadata definitions detected. Thelibrary definition for the Drill-Through table ismissing.

The dimension table metadata is checked onvarious functions in SAS OLAP Cube Studio,including the Create cube, Synchronize cube,Properties, Edit Cube Structure, and ManualTuning dialog boxes. It is also checked on theFinish page of the Cube Designer wizard. If youreceive this message, open Data IntegrationStudio and replace the missing libref for thetable.

Note: You can also receive the message whencreating code in SAS Data Integration Studio.

Changes to metadata definitions detected. Thelibrary definition for the Drill-Through table ismissing. Processing will continue.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Changes to metadata definitions detected. Thelibrary definition for one of the input tables ismissing. Cube metadata will be saved, but thecube cannot be created.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Changes to metadata definitions detected. ThePROC OLAP code cannot be generated becausethe library definition for one of the input tablesis missing.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Page 127: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS OLAP Cube Studio Messages � Cube Designer Error Messages 119

Error Message Comment

Problems with dimension key metadatadefinitions have been automatically resolved.Use the Dimension Designer to verifyautomatically selected dimension keys. Do youaccept the current dimension keys?

There are several locations in SAS OLAP CubeStudio where star schema metadata is verified,including the Create, Manual Tuning, and SavePROC OLAP code dialog boxes and theSynchronize levels function.

The error is possibly with the dimension keys.You need to edit the cube structure and makesure automatically selected keys are acceptable.

Note: You can also receive the message whengenerating code in SAS Data Integration Studio.

Problems with dimension key metadatadefinitions for the <dimension name> dimensionhave been automatically resolved. Use theDimension Designer to verify automaticallyselected dimension keys.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Changes to cube metadata definitions detected.Edit the cube structure for automatic resolutionsto the detected changes. Selecting Cancel at anytime will not save metadata changes.

This message is received when there are changesto the input columns for levels and measures,and when aggregate columns for measures havebeen removed from the metadata. You willreceive this message any time you receive othermetadata messages. In addition, you will onlybe able to use the Edit Cube Structure function.

You should open SAS Data Integration Studio tocreate new metadata for the missing items. Youcan then return to SAS OLAP Cube Studio anduse the Edit Cube Structure function to repairthe cube metadata.

Changes to metadata definitions detected. The<dimension name> star schema dimension ismissing a key column definition. Modify thedimension in the Cube Designer to redefine thekey column.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Changes to metadata definitions detected. The<dimension name> Dimension does not have allthe tables for selected languages. Use the CubeDesigner to verify selected languages or definelanguage tables needed for this dimension.

See SAS Intelligence Platform and specificallySAS Management Console documentation forfurther information about metadata definitions.

Incomplete cube metadata detected. No inputtable. The cube must be deleted.

This message is received in the workspace whenaccessing various SAS OLAP Cube StudioNavigation Tree selections, including Create,Properties, and Edit Cube Structure.

Changes to metadata definitions detected. ThePROC OLAP code cannot be saved because thelibrary definition for one of the input tables ismissing.

This message is specific to libref problems whenyou are selecting Save PROC OLAP codefrom the workspace or from the Finish page.

Changes to metadata definitions detected. Thedimension key column for the <dimensionname> dimension has changed. Modify thedimension to redefine the dimension key column.

This message is received if the keys cannot berepaired.

Page 128: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

120 Cube Designer Error Messages � Appendix 2

Error Message Comment

The updates to the cube could not be saved. Thedeletion of the existing cube failed.

This message is received on the Finish page ifthe code submitted to the application serverfailed to delete the cube. The Cube Designerwizard cannot determine why the deletefunction failed. You should check the applicationserver and try again.

The code to create the cube could not besubmitted because the connection to a SASWorkspace Server failed.

You must be connected to a workspace server tocreate the physical cube. You should establish aconnection to an application server and try tocreate the cube again.

The updates to the cube could not be saved. Theexisting cube must first be deleted. However, theconnection to a SAS Workspace Server failedand the delete code could not be submitted.

This message is received when an existing cubeneeds to be deleted, but there is no applicationserver connection. You should establish aconnection to an application server and try todelete the cube again.

A cube type of HOLAP is specified, but noaggregation tables are identified. PressingFinish will revert the cube type to MOLAP.

This message is received when you have clickedto the Finish page and a HOLAP-type cube doesnot have any aggregations. This is only awarning. You do not have to create storedaggregations.

Cube name must be unique. You must enter a cube name that does notalready exist within the selected OLAP schema.

Input type selection has changed. Clicking OKwill remove the cube’s current input-relateddefinitions if they have been specified.

This message is received when the input type onthe General page has changed.

The connection to a SAS Workspace Serverfailed. Unable to display the Browse dialog box.

This message is received when a connection to aworkspace server has not been established andthe Browse button is selected for either thePath or Work Path on the General page.Establish a connection to a workspace serverand try again.

There are no OLAP schemas defined in themetadata.

This message is received when the Next buttonis selected on the General page and an OLAPschema has not been defined in the activemetadata repository. Assign an OLAP schema tothe active metadata repository and then definethe cube.

An OLAP schema is not defined for this cube.Please select an OLAP Schema.

This message is received when an OLAP schemahas not been selected on the General page.Select an OLAP schema from the drop-down list.

All stored aggregation definitions will beremoved.

This message is received when the input type ischanged to detail table or star schema, and thecheck box for The cube will also useaggregated data from other tablesoption has not been selected.

Page 129: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS OLAP Cube Studio Messages � Cube Designer Error Messages 121

Error Message Comment

You have changed the group name for a storedmeasure. Do you want to change the groupname for all measures in that group? If youselect no, the derived measures may be affected.

This message is received when you are definingstored measures for a cube and you change theAnalysis Group name for a measure on theAssign Stored Measures page. Select Yes tochange the group name for all measures in theanalysis group.

A table must be selected as input to the cube. This message is received on the Input pagewhen you have not selected an input source forthe cube you are creating. You must specify thedata source that provides the input data for yourcube.

Table selection has changed. Clicking OK willremove current cube definitions.

This message is received on the Input pagewhen you reselect the input table. Selecting OKwill reset all definitions in the cube.

The <statistic name> statistic is already usedwith the <group name> analysis group.

This message is received when you are definingstored measures for a cube and you assign astatistic that is already used on the AssignStored Measures page.

The <measure name> derived measure is notpossible.

This message is received when you are selectingmeasures for a cube. If stored aggregations existfor the cube, a derived measure cannot becreated unless all required stored measureshave already been created.

All aggregation column names must be the sameon all tables. Select Back to select the correcttables, or don’t select any tables.

This message is received on either the SelectMeasures page or the Generated Aggregationspage. A table must have matching columnnames with other tables for the cube. You canmodify the table in SAS Data Integration Studioand add the correct columns.

Measure name already exists for this cube. The measure name already exists. You mustspecify a different measure name.

A measure name must be specified. You must specify a name for the measure.

Setting the format to blank will set the formatto the default format. There is no default formatfor this measure.

This message is received on the Measure Detailspage for HOLAP and MOLAP measures. If aformat is not entered or selected and no defaultformat exists, then this message is received.

Setting the format to blank will set the formatto the default format. The default format forthis measure is <format>.

This message is received on the Measure Detailspage for HOLAP and MOLAP measures. If aformat is not entered or selected, then thedefault format will be used.

At least one measure must be defined for thecube.

This message is received on the Select Measurespage. At least one measure must be selected forthe cube.

Page 130: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

122 Cube Designer Error Messages � Appendix 2

Error Message Comment

One or more derived measures statistics is notpossible with the given groups. Do you want tocontinue?

This message is received when you are changinggroup names or statistics for a cube that hasderived measures. The Assign Statistics Grouppage determines if any existing derivedmeasures are invalid. You will receive thismessage if there are invalid derivedmeasures.You should replace the incorrectstatistics with valid statistics.

A group name must be assigned for eachmeasure.

This message is received on the Assign StoredMeasures page. An analysis group name mustbe assigned for each measure.

A statistic must be assigned for each measure. This message is received on the Assign StoredMeasures page. A statistic must be assigned foreach measure.

No derived measures are possible with thecurrently defined stored measures. Checkassigned analysis groups to make sure storedmeasures needed for a derived statistic have thesame analysis group.

This message is received on the Select DerivedMeasures page. If you have stored measuresalready created for the cube, you cannot createderived measures for the cube. You can modifythe analysis groups for these measures.

The limit of 1024 measures has been exceeded. This message is received on the Select Measurespage when you have exceeded the limit of 1024.

At least one non-Distinct Count(non-NUNIQUE) measure must be defined.

This message is received on the Select Measurespage. You must select a measure from the list ofavailable measures.

The SAS_SPATIAL_ID properties cannot bedeleted here. To delete the property, edit themap information for the GEO dimension.

This message is received on the MemberProperty page. When ESRI map information isadded to a cube, the property objects for themapped cube levels are listed with the cube’smember properties. These member propertiesare named SAS_SPATIAL_ID by default andcannot be deleted on this page.

You must specify an aggregate column for allstored measures. A stored measure is a measurethat has SUM, N, NMISS, MIN, MAX or USS asthe statistic.

This message is received on the Map Measuresto Aggregated Columns page. When specifyingstored measures, you must indicate anaggregate column.

You must select an aggregation table. This message is received on the Specify a StoredUser-Defined Aggregation page, which isaccessed from the Stored Aggregations page.You must select an aggregation table whenadding a stored aggregation.

A hierarchy is required to define a memberproperty.

This message is received on the Define a MemberProperty page. You must have a hierarchy in theSelected Hierarchies list.

You must select a level to define a memberproperty.

This message is received on the Define aMember Property page. You must have a levelselected for the member property.

Page 131: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS OLAP Cube Studio Messages � Cube Designer Error Messages 123

Error Message Comment

You must select levels to define a useraggregation.

This message is received on the Manual Tuningdialog box. You must have one or more levelslisted in the Selected list.

A name is required to define a member property. This message is received on the Define aMember Property page. You must enter a namefor the member property.

The aggregation name is required. This message is received on the GeneratedAggregations page when adding an aggregation.When specifying an aggregation, you must entera name.

You must select a property for the level. This message is received on the MemberProperty page. A column representing a memberproperty hasn’t been assigned to the level.Select a property for the level.

All stored measure names must be containedwithin the aggregation tables. Select the correctaggregation tables or don’t select any tables tocontinue.

This message is received on the Measure Mappage and the Generated Aggregations page. Ifthe input to the cube is fully summarized, thenthe names of columns in the input table mustmatch the names of the columns in a selectedaggregation table. If not, then a differentaggregation table needs to be selected.

Ragged hierarchy options for the <dimensionname> Dimension must be corrected in CubeDesigner.

This message is received when there is aproblem with the current definition for raggedhierarchies. You must define the correct raggedhierarchy options for the cube. Click theAdvanced button on the General page of theCube Designer wizard. Select the RaggedHierarchies tab and define the raggedhierarchies.

The specified cube name is not unique withinthe OLAP schema. Please enter a new nameand select OK to complete the Cube Designer.Or select Cancel to return to the Cube DesignerFinish page.

This message is received on the Cube DesignerFinish page. While creating a cube, a differentcube with the same name was saved to theapplication server. You should return to theGeneral page and enter a new cube name.

A valid path must be entered to save the PROCOLAP code.

This message is received on the Save PROCOLAP Code dialog box when saving PROC OLAPcode to a text file. You must enter a valid filesystem path to save the PROC OLAP code to.

The value for the COMPACT_NWAY optionmust be 0 or 1.

This message is received on the Advanced pagethat is accessed from the General page in theCube Designer. This message is set internally toeither 0 or 1 and is rarely received.

The <hierarchy name> levels must go from themost general time period to the most specific.The <level name> level does not follow this rule.Please modify the <hierarchy name> hierarchy.

When defining the hierarchy for a timedimension, you must list the levels in a specificorder, going from general to specific in nature.

Page 132: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

124 Dimension Designer Error Messages � Appendix 2

Error Message Comment

Cannot add new measures. The maximumnumber of measures for a cube has been reached.

This message is received on the Select Measurespage if the limit of 1024 measures is exceeded.It applies only to MOLAP-type cubes.

The aggregation table for this aggregation wasdeleted. Please delete this aggregation or goback and add the table that this aggregationwas defined from.

This message is received when you modify astored aggregation and the associatedaggregation table has been removed. In thiscase the stored aggregations for the cube shouldalso be removed.

Aggregation tables have not been selected. Thiswill prevent any user-defined storedaggregations. Select OK to continue or Cancel toselect aggregation tables.

This message is received on the AggregationTables page. You have not selected anaggregation table for the cube.

The aggregation tables you selected do notcontain any levels within your cube. This willprevent any user-defined stored aggregations.Select OK to continue or Cancel to selectaggregation tables.

This message is received on the AggregationTables page. If there are not any columns in thetable that has been selected, then it isimpossible to map the levels to that table. Youcan select another table or modify the tablecolumns in SAS Data Integration Studio.

Dimension Designer Error Messages

Table A2.2 Dimension Designer Error Messages

Error Message Comment

Enter a name for the dimension that is uniqueto a level name.

This message is received at the end of theDimension Designer wizard on the Hierarchypage. When a new dimension is created, it isvalidated by SAS OLAP Cube Studio. If thedimension name matches one of the level namesyou will receive this message. Change the nameof the dimension to something other than one ofthe selected level names.

Dimension name already exists for this cube. This message is received on the DimensionDesigner General page. The dimension namegiven matches the name of an existingdimension. You must enter a differentdimension name.

Only one GEO dimension allowed for a cube. This message is received on the DimensionDesigner General page. There can be only oneGEO-type dimension for a cube. Change thedimension type to STANDARD or TIME.

Page 133: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS OLAP Cube Studio Messages � Dimension Designer Error Messages 125

Error Message Comment

Hierarchy name already exists for thisdimension.

This message is received on the DimensionDesigner Define a Hierarchy page. Thehierarchy name has already been created forthis dimension. You must enter a differenthierarchy name.

Hierarchy name already exists for this cube. The hierarchy name has already been createdfor this cube. You must enter a differenthierarchy name.

Only one TIME dimension allowed for a cube. This message is received on the DimensionDesigner General page. You can only have oneTIME dimension for a cube. Change thedimension type to STANDARD or GEO.

The hierarchy name cannot be the same as alevel name.

This message is received on the Define aHierarchy page. You cannot assign a name to ahierarchy that is the same as that for a level.You must enter a unique name.

The <level name> level is not defined in anyhierarchy.

This message is received on the Hierarchy page.You must use all levels selected for thedimension in at least one hierarchy. If a levelisn’t used, you must either remove the level orassign it to a hierarchy.

A dimension name is required. Enter a newname that is not a level name.

This message is received on the DimensionDesigner wizard. The dimension name must beunique and different from the names of thelevels assigned to the dimension.

A dimension table must be selected. This message is received on the DimensionDesigner General page when defining starschema dimension tables. You must select adimension table from the list box.

Dimension name is required. This message is received on the DimensionDesigner General page if a name is not given.You must enter a name for the dimension.

A dimension key is required. This message is received on the DimensionDesigner General page when defining starschema dimension tables. You must select a keyfrom the list box.

A fact key is required. This message is received on the DimensionDesigner General page when defining starschema dimension tables. You must select a factkey from the list box.

Hierarchy name is required. This message is received on the Define aHierarchy page. You must enter a name for thehierarchy.

You must select levels. This message is received on several locations,including the Dimension Designer Wizard,Manual Tuning dialog box, and the DefinedAggregations page. You must select one or morelevels from the list of available levels.

Page 134: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

126 Dimension Designer Error Messages � Appendix 2

Error Message Comment

You must select levels for the hierarchy. This message is received on the Define aHierarchy page. You must select one or morelevels from the list of available levels.

The <hierarchy name> hierarchy still containsdifferent ragged hierarchy options. Pleasemodify any hierarchy and specify the raggedoptions you would like for all hierarchies.

This message is received on the Define aHierarchy page. You must enter the correctragged hierarchy information.

The hierarchies contain different raggedhierarchy options. Please modify any hierarchyand specify the ragged options you would like forall hierarchies.

This message is received on the Define aHierarchy page. You must enter the correctragged hierarchy information.

Cannot add new dimensions. The maximumnumber of dimensions for a cube has beenreached.

This message is received on the Cube DesignerDimensions page when the limit of 128dimensions has been met.

Cannot add new hierarchies. The maximumnumber of hierarchies for a cube has beenreached.

This message is received on the Hierarchy pagewhen the limit of 128 hierarchies has been met.

Cannot add new levels. The maximum numberof levels for a cube has been reached.

This message is received on the Cube DesignerDimensions page when the limit of 256 levelshas been met. You will receive this messagespecifically on the following pages:

� the Cube Designer Dimensions page if youtry to add another dimension

� the Dimension Designer Levels page if youtry to create a new level

Cannot add new levels. The maximum numberof levels for a dimension has been reached.

This message is received on the DimensionDesigner Levels page if the number of selectedlevels exceeds 19.

Cannot add new member properties. Themaximum number of member properties hasbeen reached.

This message is received on the MemberProperty page. You cannot have more than 256member properties per cube.

The WEEKS level type is not allowed ifHALF_YEARS, QUARTERS or MONTHS areselected within the hierarchy.

This message is received on the DimensionDesigner Levels page. You must select thecorrect combination of levels for a TIME-typedimension.

Page 135: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

SAS OLAP Cube Studio Messages � Miscellaneous Error Messages 127

Specify Map Error Messages

Table A2.3 Specify Map Error Messages

Error Message Comment

Some of the map information is missing. Pleasecorrect the problems.

This message is received on the Specify Map forDimension page.

A column appropriate for the selected field IDmust be selected.

This message is received on the Specify Map forDimension page. You must select a Field IDcolumn.

A map layer has been assigned but no field IDhas been assigned.

This message is received on the Specify Map forDimension page. You must assign a field ID.

There are no map field IDs associated with theselected map layer.

This message is received on the Specify Map forDimension page and refers to an MdExceptionproblem with the metadata server. Thismessage is uncommon.

There are no map layers associated with theselected map service.

This message is received on the Specify Map forDimension page.

No layers have been assigned to the levels. This message is received on the Specify Map forDimension page. You must assign map layers tothe cube levels.

A map server has been selected but no mapservice is selected.

This message is received on the Specify Map forDimension page. You must select a map service.

There are no map services associated with theselected map server.

This message is received on the Specify Map forDimension page.

Miscellaneous Error Messages

Table A2.4 Miscellaneous Error Messages

Cube Studio Category Error Message Comment

Cube Studio A valid SAS name must beentered.

You must enter a valid SASname. This message isreceived when SAS OLAPCube Studio verifies the namesfor the cube, dimensions,hierarchies, measures, andmember properties.

Model The cube is missing the versionproperty object.

The version property objectmust be identified.

Page 136: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

128 Miscellaneous Error Messages � Appendix 2

Cube Studio Category Error Message Comment

Model Cube metadata version<version number> is notsupported.

This message is received whenyou attempt to create a modelusing a cube with a higherversion than the model. Thismessage appears before anyCube Designer pages appear.

Performance Option (CONCURRENT) The numberof aggregations to create inparallel must be an integergreater than or equal to 0.

This message is received on theGlobal Performance Optionspage if you enter a concurrentvalue below 0.

Performance Option (INDEXSORTSIZE) Theamount of memory (inmegabytes) available foraggregation creation must bebetween 32 and 10239.

This message is received on theGlobal Performance Optionspage if you enter an index sortsize between 32 and 10239.

Performance Option (MAXTHREADS) Themaximum number of threadsused to create the aggregationindex must be between 0 and65536.

This message is received on theGlobal Performance Optionspage if you enter a maximumnumber of threads that is lessthan or equal to 0 or greaterthan or equal to 65536.

Performance Option (PARTSIZE) The number ofaggregations to create inparallel must be 16 or more.

This message is received on theGeneratedAggregationsPerformance Optionstabs for either Global orAggregation options. Thesetting for Partition size(in megabytes) ofaggregation tablepartitions must be 16 ormore.

Performance Option (SEGSIZE) The number ofobservations (in kilobytes) toinclude in the index componentfile segment must be 1 or more.

This message is received on theGeneratedAggregationsPerformance Optionstabs for either Global orAggregation options. Thesetting for Number ofobservations (inkilobytes) to includein the indexcomponent filesegment must be 1 or more.

Page 137: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

129

A P P E N D I X

3SAS OLAP Cube StudioAccessibility Features

SAS OLAP Cube Studio Accessibility Features 129

SAS OLAP Cube Studio Accessibility FeaturesSAS OLAP Cube Studio includes the following accessibility and compatibility

features that improve usability of the product for users with disabilities. These featuresare related to accessibility standards for electronic information technology that wereadopted by the U.S. Government under Section 508 of the U.S. Rehabilitation Act of1973, as amended.

For further information on accessibility features in SAS, see Accessibility Features inSAS under Windows and Default Key Settings for Interactive SAS Sessions underWindows in SAS OnlineDoc.

Note: If you have questions or concerns about the accessibility of SAS products,send e-mail to [email protected]. �

Table A3.1 Window Manipulation Keys

Window Manipulation Key Action

ALT+F4 Closes active applications on the desktop.ALT+F4 Closes SAS OLAP Cube Studio.

ALT+F6 Switches to the next window between modelesssecondary windows and their primary window.

ALT+SPACEBAR Opens the title bar icon and displays theprogram menu of the leftmost icon on the titlebar.

ALT+TAB Provides a pop-up menu of active applications,identified by their product graphics.

ALT+TAB+SHIFT Reverses direction through the pop-up menu.

ALT+HYPHEN Displays the shortcut menu for the active MDIwindow.

ALT+ESC Navigates active applications on the desktopand then desktop shortcut bar items. Releasingthe ESC key selects an application.

Page 138: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

130 SAS OLAP Cube Studio Accessibility Features � Appendix 3

Window Manipulation Key Action

ALT+ESC+SHIFT Reverses the navigation direction of activeapplications on the desktop and the desktopshortcut bar. Navigates windows in reverseorder.

ALT+ENTER Displays the properties of a selected item whileyou are working in a window.

PRINT SCREEN Copies a screen image to the clipboard.

ALT+ PRINT SCREEN Copies an active window image to the Windowsclipboard.

Table A3.2 Actions Performed with the ALT Key.

Action Procedure

Move the application window In SAS OLAP Cube Studio, select the ALT keyand perform the following steps:

1 Choose Move from title bar menu.

2 Use the arrow keys to move the window.

3 Press ENTER to accept or ESC to cancel.

Size the application window In SAS OLAP Cube Studio, select the ALT keyand perform the following steps:

1 Choose Size from title bar menu.

2 Use an arrow key to choose which windowborder to move.

3 Resize the window with the appropriatearrow keys.

4 Press ENTER to accept or ESC to cancel.

Minimize/Maximize the application window In SAS OLAP Cube Studio, perform thefollowing steps:

1 Choose Minimize from the title barmenu.

2 Choose Maximize from the title barmenu.

Restore the application window In SAS OLAP Cube Studio, select the ALT keyand select Restore from title bar menu. Theapplication is returned to its original state.

Page 139: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

131

A P P E N D I X

4Recommended Reading

Recommended Reading 131

Recommended Reading

Here is the recommended reading list for this title:� Administrator for Enterprise Clients: User’s Guide� SAS Data Providers: ADO/OLE DB Cookbook

� SAS Language Reference: Concepts� SAS Language Reference: Dictionary� SAS Management Console: User’s Guide

� SAS Intelligence Platform: System Administration Guide� SAS Intelligence Platform: Data Administration Guide� SAS OLAP Server: Concepts and Excerpts from “MDX Solutions with Microsoft

SQL Server Analysis Services”� SAS OLAP Server: MDX Guide

� SAS Companion that is specific to your operating environment

For a complete list of SAS publications, see the current SAS Publishing Catalog. Toorder the most current publications or to receive a free copy of the catalog, contact aSAS representative at

SAS Publishing SalesSAS Campus DriveCary, NC 27513Telephone: (800) 727-3228*Fax: (919) 677-8166E-mail: [email protected] address: support.sas.com/pubs* For other SAS Institute business, call (919) 677-8000.

Customers outside the United States should contact their local SAS office.

Page 140: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

132

Page 141: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

133

Glossary

aggregationa summary of detail data that is stored with or referred to by a cube. Aggregationssupport rapid and efficient answers to business questions.

aggregation tablea table that contains pre-calculated totals. Aggregation tables can be referred to bycubes, reducing the amount of time that is required for building the cubes.

ARM (Application Response Measurement)an application programming interface that was developed by an industry partnershipand which is used to monitor the availability and performance of softwareapplications. ARM monitors the application tasks that are important to a particularbusiness.

base tablea table that contains detail data that is used for building cubes or aggregation tables.

calculated memberin a dimension, a member whose value is derived from the values of other members.

childwithin a dimension hierarchy, a descendant in level n-1 of a member that is at leveln. For example, if a Geography dimension includes the levels Country and City, thenBangkok would be a child of Thailand, and Hamburg would be a child of Germany.

cubea logical set of data that is organized and structured in a hierarchical,multidimensional arrangement. A cube is a directory structure, not a single file. Acube includes measures, and it can have numerous dimensions and levels of data.

custom repositoryin the SAS Open Metadata Architecture, a metadata repository that must bedependent on a foundation repository or custom repository, thus allowing access tometadata definitions in the repository or repositories on which it depends. A customrepository is used to specify resources that are unique to a particular data collection.For example, a custom repository could define sources and targets that are unique toa particular data warehouse. The custom repository would access user definitions,group definitions, and most server metadata from the foundation repository. See alsofoundation repository, project repository.

Page 142: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

134 Glossary

data cleansingthe process of eliminating inaccuracies, irregularities, and discrepancies from data.

data scrubbinganother term for data cleansing. See data cleansing.

data sparsitya characteristic of a multidimensional data source in which there is a relatively highproportion of empty cells (which indicate missing data values) to filled cells.

data warehousea collection of data that is extracted from one or more sources for the purpose ofquerying and analysis.

descendantin a dimension hierarchy, a member that resides at a lower level in relation to othermembers in the hierarchy. For example, if a Geography dimension includes the levelsCountry, State, and City, then California and Los Angeles would be descendants ofUSA.

detail datanonsummarized (or partially summarized) factual information that pertains to asingle area of interest, such as sales figures, inventory data, or human-resource data.

dimensiona group of closely related hierarchies. Hierarchies within a dimension typicallyrepresent different groupings of information that pertains to a single concept. Forexample, a Time dimension might consist of two hierarchies: (1) Year, Month, Date,and (2) Year, Week, Day. See also hierarchy.

dimension tablein a star schema, a table that contains the data for one of the dimensions. Thedimension table is connected to the star schema’s fact table by a primary key. Thedimension table contains fields for each level of each hierarchy that is included in thedimension.

drill downin a view of an OLAP cube, to start at one level of a dimension hierarchy and to clickthrough one or more lower levels until you reach the data that you are interested in.

drill upin a view of an OLAP cube, to start at one level of a dimension hierarchy and to clickthrough one or more higher levels until you reach the level of summarized data thatyou are interested in.

drill-through tablea view, data set, or other data file that contains data that is used to define a cube.Drill-through tables can be used by client applications to provide a view fromprocessed data into the underlying data source.

facta single piece of factual information in a data table. For example, a fact can be anemployee name, a customer’s phone number, or a sales amount. It can also be aderived value such as the percentage by which total revenues increased or decreasedfrom one year to the next.

fact tablethe central table in a star schema. The fact table contains the individual facts thatare being stored in the database as well as the keys that connect each particular factto the appropriate value in each dimension.

Page 143: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Glossary 135

foreign keya column or combination of columns in one table that references the correspondingprimary key in another table. A foreign key must have the same attributes as theprimary key that it references.

foundation repositoryin the SAS Open Metadata Architecture, a metadata repository that is used tospecify metadata for global resources that can be shared by other repositories. Forexample, a foundation repository is used to store metadata that defines users andgroups on the metadata server. Only one foundation repository should be defined ona metadata server. See also custom repository, project repository.

granularitythe relative level of detail that a data item represents. From the top of a dimensionto the bottom, granularity increases. For example, in a Time dimension that consistsof a Year-Month-Day hierarchy, Month is more granular than Year, and Day is moregranular than Month.

hierarchyan arrangement of members of a dimension into levels that are based on parent-childrelationships. Members of a hierarchy are arranged from more general to morespecific. For example, in a Time dimension, a hierarchy might consist of the membersYear, Quarter, Month, and Day. In a Geography dimension, a hierarchy might consistof the members Country, State or Province, and City. More than one hierarchy can bedefined for a dimension. Each hierarchy provides a navigational path that enablesusers to drill down to increasing levels of detail. See also member, level.

HOLAP (hybrid online analytical processing)a type of OLAP in which relational OLAP (ROLAP) and multidimensional OLAP(MOLAP) are combined. In HOLAP, the source data is usually stored using a ROLAPstrategy, and aggregations are stored using a MOLAP strategy. This combinationusually results in the smallest amount of storage space. In HOLAP, aggregates canbe pre-calculated and can be linked into a hybrid storage model.

informata pattern or set of instructions that SAS uses to determine how data values in aninput file should be interpreted. SAS provides a set of standard informats and alsoenables you to define your own informats.

leaf memberthe lowest-level member of a hierarchy. Leaf members do not have any childmembers.

levelan element of a dimension hierarchy. Levels describe the dimension from the highest(most summarized) level to the lowest (most detailed) level. For example, possiblelevels for a Geography dimension are Country, Region, State or Province, and City.

logical serverin the SAS Metadata Server, the second-level object in the metadata for SAS servers.A logical server specifies one or more of a particular type of server component, suchas one or more SAS Workspace Servers.

MDDB (multidimensional database)another term for cube. See cube.

MDX (multidimensional expressions) languagea standardized, high-level language that is used for querying multidimensional datasources. The MDX language is the multidimensional equivalent of SQL (StructuredQuery Language).

Page 144: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

136 Glossary

measurea special dimension that contains summarized numeric data values that areanalyzed. Total Sales and Average Revenue are examples of measures. For example,you might drill down within the Clothing hierarchy of the Product dimension to seethe value of the Total Sales measure for the Shirts member.

membera name that represents a particular data element within a dimension. For example,September 1996 might be a member of the Time dimension. A member can be eitherunique or non-unique. For example, 1997 and 1998 represent unique members in theYear level of a Time dimension. January represents non-unique members in theMonth level, because there can be more than one January in the Time dimension ifthe Time dimension contains data for more than one year.

metadata profilea definition of where a metadata server is located. The definition includes a hostname, a port number, and a list of one or more metadata repositories. In addition,the metadata profile can contain a user’s login information and instructions forconnecting to the metadata server automatically.

metadata repositorya collection of related metadata objects, such as the metadata for a set of tables andcolumns that are maintained by an application. A SAS Metadata Repository is anexample.

metadata servera server that provides metadata management services to one or more clientapplications. A SAS Metadata Server is an example.

MOLAP (multidimensional online analytical processing)a type of OLAP that stores aggregates in multidimensional database structures.

multi-threadingSee threading.

navigateto purposefully move from one view of the data in a table (or in some other datastructure, such as a cube) to another. Drilling down and drilling up are two examplesof navigation.

NWAY aggregationthe aggregation that has the minimum set of dimension levels that is required foranswering any business question. The NWAY aggregation is the aggregation that hasthe finest granularity. See also granularity.

OLAP (online analytical processing)a software technology that enables users to dynamically analyze data that is storedin multidimensional database (MDDB) tables.

OLAP schemaa group of cubes. A cube is assigned to an OLAP schema when it is created, and anOLAP schema is assigned to a SAS OLAP Server when the server is defined in themetadata. A SAS OLAP Server can access only the cubes that are in its assignedOLAP schema.

OLE DB for OLAPan OLAP API that is used to link OLAP clients and servers by means of amultidimensional expressions (MDX) language. See also MDX (multidimensionalexpressions) language.

Page 145: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Glossary 137

parallel I/Oa method of input and output that takes advantage of multiple CPUs and multiplecontrollers, with multiple disks per controller to read or write data in independentthreads.

parallel processinga method of processing that divides a large job into several smaller jobs that can beexecuted in parallel on multiple CPUs.

parentwithin a dimension hierarchy, the ancestor in level n of a member in level n-1. Forexample, if a Geography dimension includes the levels Country and City, thenThailand would be the parent of Bangkok, and Germany would be the parent ofHamburg. The parent value is usually a consolidation of all of its children’s values.

primary keya column or combination of columns that uniquely identifies a row in a table.

project repositorya repository that must be dependent on a foundation repository or custom repositorythat will be managed by the Change Management Facility. A project repository isused to isolate changes from a foundation repository or from a custom repository. Theproject repository enables metadata programmers to check out metadata from afoundation repository or custom repository so that the metadata can be modified andtested in a separate area. Project repositories provide a development/testingenvironment for customers who want to implement a formal change managementscheme. See also custom repository, foundation repository.

ROLAP (relational online analytical processing)a type of OLAP in which the multidimensional data is stored in a relational database.

roll upto summarize (or apply some other type of calculation or formula to) data values atone level of a dimension hierarchy in order to derive values for a parent level. Forexample, sales figures for January can be rolled up to Quarter1, and employee datafor one department can be rolled up to the division level.

SAS application servera server that provides SAS services to a client. In the SAS Open MetadataArchitecture, the metadata for a SAS application server specifies one or more servercomponents that provide SAS services to a client.

SAS ARM interfacean interface that can be used to monitor the performance of SAS applications. In theSAS ARM interface, the ARM API is implemented as an ARM agent. In addition,SAS supplies ARM macros, which generate calls to the ARM API function calls, andARM system options, which enable you to manage the ARM environment and to loginternal SAS processing transactions. See also ARM (Application ResponseMeasurement).

SAS formata pattern or set of instructions that SAS uses to determine how the values of avariable (or column) should be written or displayed. SAS provides a set of standardformats and also enables you to define your own formats.

SAS informata pattern or set of instructions that SAS uses to determine how data values in aninput file should be interpreted. SAS provides a set of standard informats and alsoenables you to define your own informats.

Page 146: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

138 Glossary

SAS Management Consolea Java application that provides a single user interface for performing SASadministrative tasks.

SAS Metadata Repositoryone or more files that store metadata about application elements. Users connect to aSAS Metadata Server and use the SAS Open Metadata Interface to read metadatafrom or write metadata to one or more SAS Metadata Repositories. The metadatatypes in a SAS Metadata Repository are defined by the SAS Metadata Model.

SAS Metadata Repositorya repository that is used by the SAS Metadata Server to store and retrieve metadata.See also SAS Metadata Server.

SAS Metadata Servera multi-user server that enables users to read metadata from or write metadata toone or more SAS Metadata Repositories. The SAS Metadata Server uses theIntegrated Object Model (IOM), which is provided with SAS Integration Technologies,to communicate with clients and with other servers.

SAS namea name that is assigned to items such as SAS variables and SAS data sets. The firstcharacter must be a letter or an underscore. Subsequent characters can be letters,numbers, or underscores. Blanks and special characters (except the underscore) arenot allowed. The maximum length of a SAS name depends on the language elementthat it is assigned to. Many SAS names, such as names of DATA step variables andarray names, can be 32 characters long. Others, such as librefs and filerefs, have amaximum length of 8 characters.

SAS OLAP Cube Studioa Java interface for defining and building OLAP cubes in SAS System 9 or later. Itsmain feature is the Cube Designer wizard, which guides you through the process ofregistering and creating cubes.

SAS OLAP Servera SAS server that provides access to multidimensional data. The data is queriedusing the multidimensional expressions (MDX) language.

SAS Open Metadata Architecturea general-purpose metadata management facility that provides metadata services toSAS applications. The SAS Open Metadata Architecture enables applications toexchange metadata, which makes it easier for these applications to work together.

schemaa map or model of the overall data structure of a database. An OLAP schemaspecifies which group of cubes an OLAP server can access.

scrubbinganother term for data cleansing. See data cleansing.

slicea subset of data from a cube, where the data in the slice pertains to one or moremembers of one or more dimensions. For example, from a cube that contains dataabout customer feedback, one slice might pertain to feedback on one particularproduct (one member of the Product dimension). Another slice might pertain tofeedback on that product from customers residing in particular geographic areas whosubmitted their feedback during a certain time period (one member of the Productdimension, multiple members of the Geography dimension, one or more members ofthe Time dimension).

Page 147: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Glossary 139

SMP (symmetric multiprocessing)a hardware and software architecture that can improve the speed of I/O andprocessing. An SMP machine has multiple CPUs and a thread-enabled operatingsystem. An SMP machine is usually configured with multiple controllers and withmultiple disk drives per controller.

sparsitySee data sparsity.

SPD (Scalable Performance Data) Enginea SAS engine that is able to deliver data to applications rapidly because it organizesthe data into a streamlined file format. The SPD Engine divides a problem (such as aWHERE clause) into smaller problems that can be processed in parallel. See alsoparallel processing.

SQL (Structured Query Language)a standardized, high-level query language that is used in relational databasemanagement systems to create and manipulate database management system objects.

star schematables in a database in which a single fact table is connected to multiple dimensiontables. This is visually represented in a star pattern. SAS OLAP cubes can becreated from a star schema.

stored statisticsstatistics that are stored in a cube. Stored statistics can be used to derivehigher-level statistics. Examples include sum, minimum, and maximum.

threada single path of execution of a process in a single CPU, or a basic unit of programexecution in a thread-enabled operating system. In an SMP environment, which usesmultiple CPUs, multiple threads can be spawned and processed simultaneously.Regardless of whether there is one CPU or many, each thread is an independent flowof control that is scheduled by the operating system. See also SMP (symmetricmultiprocessing), thread-enabled operating system, threading.

thread-enabled operating systeman operating system that can coordinate symmetric access by multiple CPUs to ashared main memory space. This coordinated access enables threads from the sameprocess to share data very efficiently.

threadinga high-performance method of data I/O or data processing in which the I/O orprocessing is divided into multiple threads that are executed in parallel. In theboss-worker model of threading, the same code for the I/O or calculation process isexecuted simultaneously in separate threads on multiple CPUs. In the pipelinemodel, a process is divided into steps, which are then executed simultaneously inseparate threads on multiple CPUs. See also parallel I/O, parallel processing, SMP(symmetric multiprocessing).

Time dimensiona dimension that divides time into levels such as Year, Quarter, Month, and Day.

tuplea data object that contains two or more components. In OLAP, a tuple is a slice ofdata from a cube. It is a selection of members (or cells) across dimensions in a cube.It can also be viewed as a cross-section of member data in a cube. For example,([time].[all time].[2003], [geography].[all geography].[u.s.a.], [measures].[actualsum])is a tuple that contains data from the Time, Geography, and Measures dimensions.

Page 148: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

140 Glossary

wizardan interactive utility program that consists of a series of dialog boxes, windows, orpages. Users supply information in each dialog box, window, or page, and the wizarduses that information to perform a task.

Page 149: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Index 141

Index

AADO MD

cubes with 69Advanced Aggregation Tuning plug-in 51

setting tuning and performance options 53AGGR_COLUMN= option

MEASURE statement (OLAP) 98aggregation design 9AGGREGATION statement

OLAP procedure 99aggregation storage 19

choosing MOLAP or ROLAP 20MOLAP 20ROLAP 20

aggregation tables 8defining cubes with 107

aggregations 2, 4adding to cubes 114deleting from cubes 101, 114

ANALYSIS argumentMEASURE statement (OLAP) 97

ARM analysis tuning 51

Bbase tables 8

Ccalculated members

adding to cubes 65Calculated Members plug-in 66

calculation types 66custom calculations 67simple calculations 66time analysis calculations 67

CAPTION= optionDIMENSION statement (OLAP) 87HIERARCHY statement (OLAP) 94LEVEL statement (OLAP) 90MEASURE statement (OLAP) 98PROPERTY statement (OLAP) 92

cells 4character encoding

SAS servers and 55, 106COLUMN argument

MEASURE statement (OLAP) 97

COLUMN= optionPROPERTY statement (OLAP) 92

COMPACT_NWAY optionPROC OLAP statement 79

COMPRESS optionAGGREGATION statement (OLAP) 100OLAP procedure 54PROC OLAP statement 79

CONCURRENT= optionOLAP procedure 54PROC OLAP statement 79

connection pointsexporting and importing cubes 59

copying cubes 60count statistics 14cross-dimensional tuning 51cube aggregations

importing cubes 58performance options 52tuning 49tuning options 52

Cube Designer 11building cubes from detail tables 23defining member properties 14defining multiple hierarchies 16defining ragged and unbalanced hierar-

chies 17dimension table translations 55error messages 117setting tuning and performance options 52

cube metadatarefreshing 48storage location requirements 13

CUBE= optionPROC OLAP statement 80

cube structure 4cubes 3

accessing from SQL Pass-Through facility 62adding aggregations to 114adding calculated members 65adding system options to 55ADO MD with 69aggregation storage 19building 11building from detail tables 23building from existing definition 113building from star schema 38building from summary tables 32changing data and index paths 62copying 60

creating the physical cube 12data management 7data storage with 6default hierarchy 15defining member properties 13defining with data tables 8defining with tables 107deleting 115deleting aggregations from 101, 114directories for 13distinct count measures 14exporting 56importing 56loading from detail tables 109loading from star schema 110loading with summarized data 112maintenance 7Microsoft Excel 2000 with 73Microsoft Excel 2002 PivotTable with 73moving 60multi-threading and 7multiple hierarchies 15OLE DB for OLAP with 69preparations for building 12ProClarity Professional with 76ragged and unbalanced hierarchies 16SAS products with 70saving OLAP procedure code 26setup 7size specifications 21synchronizing 56tables for creating cubes in metadata 12third-party clients with 73updating 48

Ddata access 2data analysis 7data management 7DATA= option

PROC OLAP statement 80data path 62data preparation 7data storage 2

cubes for 6data tables

defining cubes 8data warehouse 2

Page 150: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

142 Index

DATAPATH= optionAGGREGATION statement (OLAP) 100OLAP procedure 54PROC OLAP statement 80

default hierarchy 15DEFAULT option

HIERARCHY statement (OLAP) 94MEASURE statement (OLAP) 99

Define Distinct Count Measures function 14DEFINE statement

OLAP procedure 102DELETE option

PROC OLAP statement 80DELETE_PHYSICAL option

PROC OLAP statement 81DESC= option

DIMENSION statement (OLAP) 87HIERARCHY statement (OLAP) 94LEVEL statement (OLAP) 90MEASURE statement (OLAP) 99PROC OLAP statement 81PROPERTY statement (OLAP) 92

detail tables 8building cubes from 23defining cubes with 107loading cubes from 109

dimension design 7Dimension Designer

error messages 124DIMENSION statement

OLAP procedure 86dimension table translations 54dimension tables 8

defining cubes with 107dimensions 4

GIS map information for 65multiple hierarchies for 15ragged and unbalanced hierarchies for 16

DIMKEY= optionDIMENSION statement (OLAP) 87

DIMTABLELIBREF= optionDIMENSION statement (OLAP) 88

DIMTABLEMEMPREF= optionDIMENSION statement (OLAP) 89

DIMTBL= optionDIMENSION statement (OLAP) 88

directories for cubes 13distinct count measures 14drill-through tables 9

defining cubes with 107DRILLTHROUGH_TABLE= option

PROC OLAP statement 81DROP_AGGREGATION statement

OLAP procedure 51, 101

EEMPTY= option

LEVEL statement (OLAP) 90EMPTY_CHAR= option

HIERARCHY statement (OLAP) 94PROC OLAP statement 82

EMPTY_NUM= optionHIERARCHY statement (OLAP) 94PROC OLAP statement 82

error messagesCube Designer 117Dimension Designer 124miscellaneous 127Specify Map 127

exporting cubes 56creating connection points 59file naming 59manually copying and moving cubes 60multi-language cubes 59repository considerations 59user privileges 58

FFACT= option

PROC OLAP statement 80fact tables 8

defining cubes with 107FACTKEY= option

DIMENSION statement (OLAP) 89filenames

exporting and importing cubes 59FORMAT= option

MEASURE statement (OLAP) 99

GGIS map information 65

Hhierarchies

default hierarchy 15multiple hierarchies for a dimension 15ragged and unbalanced 16

HIERARCHIES= argumentDIMENSION statement (OLAP) 87

HIERARCHY= optionPROPERTY statement (OLAP) 92

HIERARCHY statementOLAP procedure 16, 93

HOLAP 3HOST= option

METASVR statement (OLAP) 85hybrid OLAP (HOLAP) 3hyper-cubes

See cubes

IIGNORE_EMPTY option

HIERARCHY statement (OLAP) 95LEVEL statement (OLAP) 91

importing cubes 56creating connection points 59cube and aggregation path settings 58file naming 59managing cube data 58manually copying and moving cubes 60multi-language cubes 59repository considerations 59

user privileges 58INDEX option

AGGREGATION statement (OLAP) 100OLAP procedure 54PROC OLAP statement 83

index path 62INDEXPATH= option

AGGREGATION statement (OLAP) 101OLAP procedure 54PROC OLAP statement 83

INDEXSORTSIZE= optionOLAP procedure 54PROC OLAP statement 83

Integrated Object Model (IOM) 5IOM 5

JJava

SAS Web OLAP Viewer for 72

Llanguage support 54LEVEL= argument

PROPERTY statement (OLAP) 92LEVEL statement

OLAP procedure 89levels 4LEVELS= argument

HIERARCHY statement (OLAP) 93library definitions 12librefs 12loading cubes

from detail tables 109from star schema 110with summarized data 112

MManual Tuning function 50

setting tuning and performance options 53MAXTHREADS= option

OLAP procedure 54PROC OLAP statement 83

MEASURE statementOLAP procedure 15, 95

measures 4defining distinct count statistics 14

MEMBER argumentDEFINE statement (OLAP) 104UNDEFINE statement 105

member properties 13members 4

unique names 19metadata

refreshing cube metadata 48storage for cube metadata 13tables for creating cubes in 12

METASVR statementOLAP procedure 85

Microsoft Excel 2000cubes with 73

Page 151: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Index 143

Microsoft Excel 2002 PivotTablecubes with 73saving as Web page 75

Microsoft Office Web Components 2000 and2002 PivotTable 75

MOLAP 3aggregation storage 20manually copying cube files 60

moving cubes 60multi-cubes

See cubesmulti-language cubes

exporting and importing cubes 59multi-threading 7multidimensional online and analytical processing

See MOLAPmultiple hierarchies 15multiple language support 54

NNAME= argument

DROP_AGGREGATION statement(OLAP) 102

NAME= optionAGGREGATION statement (OLAP) 101

naming guidelinesSAS OLAP Server 108

.NETSAS Web OLAP Viewer for 73

NO_NWAY optionPROC OLAP statement 83

NUNIQUE statisticMEASURE statement (OLAP) 15

Oobject spawner 5OLAP 1

benefits of 2data storage and access 2variations of 3

OLAP procedure 78AGGREGATION statement 99building cubes 27COMPRESS option 54CONCURRENT= option 54DATAPATH= option 54DEFINE statement 102defining distinct count measures 15defining member properties 14defining multiple hierarchies 16defining ragged and unbalanced hierar-

chies 17DIMENSION statement 86dimension table translations 55DROP_AGGREGATION statement 51, 101HIERARCHY statement 16, 93INDEX option 54INDEXPATH= option 54INDEXSORTSIZE= option 54LEVEL statement 89MAXTHREADS= option 54MEASURE statement 15, 95

METASVR statement 85overview 78PARTSIZE= option 54performance options 116PROC OLAP statement 79PROPERTY statement 14, 91ragged hierarchy options 115REFRESH statement 49refreshing cube metadata 49saving code for cubes 26SEGSIZE= option 54setting tuning and performance options 54syntax 78tuning cube aggregations 51UNDEFINE statement 104USER_DEFINED_TRANSLATIONS state-

ment 55, 105WORKPATH= option 54

OLAP_SCHEMA= argumentMETASVR statement (OLAP) 85

OLE DB for OLAPcubes with 69

Online Analytical ProcessingSee OLAP

PPARTSIZE= option

AGGREGATION statement (OLAP) 101OLAP procedure 54PROC OLAP statement 83

PATH= optionPROC OLAP statement 84

path settings 58performance

cube aggregations 52OLAP procedure options for 116

physical cubes 12PivotTable and PivotChart Wizard 73PORT= option

METASVR statement (OLAP) 85PROC OLAP statement 79ProClarity Professional

cubes with 76PROPERTY statement

OLAP procedure 14, 91PROTOCOL= option

METASVR statement (OLAP) 85PW= option

METASVR statement (OLAP) 85

Rragged hierarchies 16

OLAP procedure options for 115unique member names and 19

REFRESH statementOLAP procedure 49

refreshing cube metadata 48REGISTER_ONLY option

PROC OLAP statement 84relational OLAP

See ROLAP

repositoryexporting and importing cubes 59

REPOSITORY= optionMETASVR statement (OLAP) 86

ROLAP 3aggregation storage 20manually copying cube files 61

SSAS AppDev Studio 70SAS Enterprise Guide 70SAS Information Map Studio 71SAS Metadata Server 5SAS OLAP Cube Studio

building cubes 23SAS OLAP Server 5

monitoring performance 52naming guidelines 108

SAS Open Metadata Interface 5SAS servers 4

character encoding and 55, 106SAS Stored Process Server 6SAS Web OLAP Viewer 72

for Java 72for .NET 73

SAS Web Report Studio 71SAS Workspace Server 5SEGSIZE= option

AGGREGATION statement (OLAP) 101OLAP procedure 54PROC OLAP statement 84

SET argumentDEFINE statement (OLAP) 104UNDEFINE statement 105

SORT_ORDER= optionDIMENSION statement (OLAP) 89LEVEL statement (OLAP) 91

Specify Maperror messages 127

SQL Pass-Through facilityaccessing cubes from 62conversion issues 62example 64SQL procedure syntax 63

SQL procedure 63star schemas

building cubes from 38input tables 8loading cubes from 110

STAT= argumentMEASURE statement (OLAP) 95

summarized dataloading cubes with 112

summary tablesbuilding cubes from 32

synchronizing cubes 56system options

adding to cubes 55

TTABLE= option

AGGREGATION statement (OLAP) 101

Page 152: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

144 Index

tablesdefining, for creating cubes in metadata 12defining cubes with 107

third-party clientscubes with 73

time analysis calculations 67tuning cube aggregations 49

Advanced Aggregation Tuning plug-in 51ARM analysis tuning 51cross-dimensional tuning 51DROP_AGGREGATION statement for 51Manual Tuning function 50monitoring OLAP server performance 52specifying tuning options 52

TYPE= optionDIMENSION statement (OLAP) 89

LEVEL statement (OLAP) 91

Uunbalanced hierarchies 16

UNDEFINE statement

OLAP procedure 104

unique member names 19

UNITS= option

MEASURE statement (OLAP) 99

user privileges

exporting and importing cubes 58

USER_DEFINED_TRANSLATIONS statement

OLAP procedure 55, 105

USERID= optionMETASVR statement (OLAP) 86

VVALIDVARNAME= system option 63

WWeb pages

saving Microsoft Excel 2002 PivotTable as 75WORKPATH= option

OLAP procedure 54PROC OLAP statement 84

Page 153: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

Your Turn

If you have comments or suggestions about SAS 9.1.3 OLAP Server: User’s Guide,Second Edition, please send them to us on a photocopy of this page, or send uselectronic mail.

For comments about this book, please return the photocopy to

SAS PublishingSAS Campus DriveCary, NC 27513E-mail: [email protected]

For suggestions about the software, please return the photocopy to

SAS Institute Inc.Technical Support DivisionSAS Campus DriveCary, NC 27513E-mail: [email protected]

Page 154: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

66

Page 155: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

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. © 2006 SAS Institute Inc. All rights reserved. 403726US.0806

SAS® Publishing gives you the tools to flourish in any environment with SAS®!

Whether you are new to the workforce or an experienced professional, you need to distinguish yourself in this rapidly changing and competitive job market. SAS® Publishing provides you with a wide range of resources— including publications, online training, and software —to help you set yourself apart.

Expand Your Knowledge with Books from SAS® PublishingSAS® Press offers user-friendly books for all skill levels, covering such topics as univariate and multivariate statistics, linear models, mixed models, fi xed effects regression, and more. View our complete catalog and get free access to the latest reference documentation by visiting us online.

s u p p o r t . s a s . c o m / p u b s

SAS® Self-Paced e-Learning Puts Training at Your FingertipsYou are in complete control of your learning environment with SAS Self-Paced e-Learning! Gain immediate 24/7 access to SAS training directly from your desktop, using only a standard Web browser. If you do not have SAS installed, you can use SAS® Learning Edition for all Base SAS e-learning.

s u p p o r t . s a s . c o m / s e l f p a c e d

Build Your SAS Skills with SAS® Learning EditionSAS skills are in demand, and hands-on knowledge is vital. SAS users at all levels, from novice to advanced, will appreciate this inexpensive, intuitive, and easy-to-use personal learning version of SAS. With SAS Learning Edition, you have a unique opportunity to gain SAS software experience and propel your career in new and exciting directions.

s u p p o r t . s a s . c o m / L E

Page 156: SAS 9.1.3 OLAP Serversupport.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/...Defining Member Properties 13 Defining Distinct Count Measures 14 Defining a Default Hierarchy 15

66