The OLAP procedure is
one of the SAS tools that you can use to create, update, and delete
cubes. It provides statements that enable you to add dimensions,
levels, hierarchies, measures, and aggregations to a cube as it is
being created. These statements, when combined with the PROC OLAP
statement and METASVR statement, are often referred to as the long
form of PROC OLAP. The long form of PROC OLAP is used when there
is no metadata definition for a cube in the SAS metadata. When submitted,
the long form of the procedure first creates the metadata definition
of the cube in the SAS metadata and then creates the physical files
for the cube. If a metadata definition for the cube specified in
the PROC OLAP statement already exists, an error message is printed
in the log.
In addition to basic
cube creation tasks, you can use a shorter form of PROC OLAP to perform
maintenance tasks on an existing cube metadata definition. The short
form of PROC OLAP must include the PROC OLAP statement and the METASVR
statement. Other statements, such as the DEFINE, AGGREGATION, DROP_AGGREGATION
and UNDEFINE statements can also be included, depending on the task
that you want to perform. These include the following:
-
delete the physical files for the
cube while leaving the metadata definition intact (PROC OLAP with
the DELETE_PHYSICAL option and METASVR statements)
-
create the physical files for the
cube based on the information in the existing metadata definition
(PROC OLAP and METASVR statements)
-
define new calculated members for
a cube or remove existing calculated members (PROC OLAP, METASVR and
DEFINE or UNDEFINE statements)
-
define new aggregations or delete
existing aggregations (PROC OLAP, METASVR, AGGREGATION or DROP_AGGREGATION
statements)
You can use SAS OLAP
Cube Studio to modify the metadata definition of a cube and then use
the short form of PROC OLAP to rebuild the cube, including the changes.
For example, if you want to add a dimension to an existing cube,
edit the cube structure in SAS OLAP Cube Studio to add the dimension.
Then, from the Finish panel of the Cube Designer, submit the short
form of PROC OLAP to delete the physical files for the cube, save
the changes to the metadata for the cube, and then submit the short
form of PROC OLAP to re-create the physical files. An advantage to
using the short form in this fashion is that links to access control
entries, information maps, and reports will not be broken as the cube
is updated.
To accomplish the same
task using the long form of PROC OLAP, you would still use the short
form with the DELETE option to delete the physical cube files and
to delete the metadata definition. The appropriate DIMENSION statements
would be added to the long form and the code submitted to create the
new metadata and the new physical files. But now the access controls
for the cube would need to be re-created and information maps and
reports would need to be adjusted to account for the newly created
cube.