![]() Previous |
![]() Next |
Within an aggregation specification, a MODEL statement executes a predefined model.
Syntax
MODEL modelname [PRECOMPUTE ALL | PRECOMPUTE NA]
Parameters
A text expression that contains the name of a predefined MODEL object.
Specifies whether the model is a static (precomputed) model or a dynamic model.
PRECOMPUTE ALL is the default and specifies a static model. The following conditions must be met:
Any RELATION or MODEL statements that precede it in the aggregation specification must also be specified as PRECOMPUTE ALL.
Any RELATION or MODEL statements that follow it in the aggregation specification can either be specified as PRECOMPUTE ALL or PRECOMPUTE NA.
PRECOMPUTE NA specifies a dynamic model. The following conditions must be met for run-time execution of the model:
All RELATION statements in the aggregation specification must appear before the MODEL statements specified as PRECOMPUTE NA.
Any additional MODEL statements that follow it in the aggregation specification must also be specified as PRECOMPUTE NA.
Usage Notes
Dynamic Models and Non-Additive Operators
Model statements are executed in the order that they are coded within the aggregation specification. Typically, when the order of execution matters to the result, MODEL statements follow the corresponding RELATION statement.
Since the order of RELATION statements that use non-additive operators (for example, MAX) effects the result of the calculation and since dynamic models (that is, MODEL statements that include a PRECOMPUTE NA phrase) must follow all RELATION statements, the use of dynamic models with non-additive operators is somewhat constrained.
Examples
For an example of using a model in an aggregation specification, see Example: Solving a Model in an Aggregation.