在PROC OLAP DATA=
选项中,您应该指定多维数据集的数据源
- 完整的非规范化表/视图(星型模式事实和维度表的连接)或
- 只是事实表(您也可以将其称为
FACT=
选项以明确)。
在情况 2 中,您还必须DIMENSION ...;
在选项中提供(通常是几个)包含对维度表的引用的语句DIMTBL=library.tablname
。
摘自http://support.sas.com/documentation/cdl/en/olapug/59574/HTML/default/viewer.htm#a002605625.htm
> DATA | FACT=dsname
>
> specifies the data source for the cube. The unsummarized data source can be any SAS data file, including files that are supported by
> SAS/ACCESS software engines. If you load the cube from a star schema,
> then the dsname is the name of the fact table that contains 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 in the star schema.
>
> You can also provide data set options along with DATA | FACT=. Options are stored within the cube and reapplied when the data is
> accessed at run time. For more 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 input data from a fully summarized external data source (a
> crossing of all dimensions known as an NWAY). In that case, you
> specify the data source for the cube by using the TABLE= option in the
> AGGREGATION statement. [cautionend]
> Interaction: If you load the cube from a star schema, then you must use the DIMENSION statement to do the following:
>
> 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 the dimension key column (the FACTKEY= option)
编辑:
一个维度可以有多个层次结构。它们(它们的列)必须驻留在非规范化基表中或语句DIMTBL=
选项中引用的一维表中DIMENSION
。
因此,如果您使用星型模式构建多维数据集,您应该为每个维度提供一个表和一个事实表。每个维度表都应包含定义一个或多个层次结构所需的所有列。
比如说,在您的情况下, DIMENSION MyDim 包含在 MyLib 库中的表 MyDim 中 - 相关语句应该是:
DIMENSION MyDim hierarchies=(First Second)
DIMKEY=D
DIMTBL=MyLib.MyDim
;
HIERARCHY First
levels=(A B D)
DEFAULT
;
HIERARCHY Second
levels=(C D)
;