The SCHEMA statement is used to define a simple star schema in the server from a single fact table and one or more dimension tables. The result of the SCHEMA statement is a temporary table that you can use as it is, or with the PROMOTE statement.
Example: | Creating a Star Schema |
specifies how to use the dimension table with the fact table. You must specify the variables to use as keys for the fact table (fact-key) and the dimension table (dim-key). The variables do not need to have the same name, but they do need to have the same type.
specifies the name of the dimension table.
specifies the variable name in the fact table to use.
specifies the variable name from the dimension table to use.
specifies a prefix to use for naming variables in the schema. If you do not specify PREFIX=, then up to the first sixteen characters of the dim-table-name are used as the dimension prefix for naming the variables in the schema.
Alias | NAME= |
specifies the server tag to use for identifying the dimension table.
specifies the variables from the dimension table to join with the fact table. By default, all variables except the dimension key are transferred from the dimension table. The dimension key is never transferred because a corresponding value is available through the fact-key.
specifies that the dimension prefix (or the dimension name, when PREFIX= is not specified), is used to modify existing column labels from the dimension tables. This enables you to identify the original table for a column by the label.
specifies whether the rows of the schema are materialized when the statement executes in the server. The default is MODE=VIEW and implies that the server resolves the relations in the tables but defers the resolution (formation) of the rows until the view is accessed. If you specify MODE=TABLE, then the table is resolved (flattened) when the statement executes. A view consumes much fewer resources (almost none), but data access is slower compared to a flattened table.
Default | VIEW |
saves the result table so that you can use it in other IMSTAT procedure statements like STORE, REPLAY, and FREE. The value for table-name must be unique within the scope of the procedure execution. The name of a table that has been freed with the FREE statement can be used again in subsequent SAVE= options.
specifies either a quoted string that contains the SAS expression that defines the temporary variables or a file reference to an external file with the SAS statements.
Alias | TE= |
specifies the list of temporary variables for the request. Each temporary variable must be defined through SAS statements that you supply with the TEMPEXPRESS= option.
Alias | TN= |