TSMODEL Procedure
Auxiliary Tables
The TSMODEL procedure can use auxiliary tables to contribute input variables to the run of the procedure step. This functionality creates a virtual data source that allows some of the input variables to physically reside in different tables. Some input variables can reside in the primary table, which is specified in the DATA= option, and other input variables can reside in the tables that are specified in one or more AUXDATA= options. This functionality enables sharing of common time series data across multiple projects.
You can specify more than one auxiliary data source to be used to input time series vectors across a particular BY-group hierarchy. To simplify data management, you can isolate variables that have naturally different levels of BY-group qualification into separate tables and use separate AUXDATA= options to supply them.
AUXDATA Functionality
There are two classes of time series table sources:
a primary table from the DATA= option
auxiliary data sources from AUXDATA= options
The AUXDATA= option specifies an auxiliary table that provides time series variables that are required for processing but are not included in the table that is specified in the DATA= option.
You can specify multiple AUXDATA= options in the PROC TSMODEL statement. Each AUXDATA= option establishes an auxiliary table source to supply variables that are declared in subsequent statements in the procedure step. If no auxiliary data sources are required, then the AUXDATA= option can be omitted.
Variables referenced in the TSMODEL procedure fall into three classes:
variables that must be physically present in the primary table, which is specified in the DATA= option
variables that must be physically present in each auxiliary table that is specified in an AUXDATA= option
variables that can reside in either the primary or an auxiliary table
The ID variable for PROC TSMODEL must be present in the primary table and all the auxiliary tables that you specify. Variables that you specify in the BY statement must be present in the primary table. The auxiliary tables must contain all of those BY variables or none of them. Partial matching of a leftmost subset of the BY variables is not supported for the auxiliary tables.
The time series variables that you specify in VAR statements can be input from either the primary table or an auxiliary table. Variable resolution proceeds in reverse order from the last AUXDATA= option in the PROC TSMODEL statement to the first. If the variable in question is not found in any of those, the variable must be present in the primary table for the procedure step to be successful.
AUXDATA Alignment across BY Groups
All variables in the BY statement must be physically present in the primary table. However, it is not necessary to have the BY variables present in any of the auxiliary tables. All or none of the BY variables can be present in any auxiliary table.
For example, suppose you have a hierarchy of (REGION, PRODUCT) in the primary table Sales, which holds the time series variables for monthly sales metrics. Suppose you have an auxiliary table called Promotions that has no BY variables and contains analysis variables for promotions, and another table called Returns that contains time series analysis variables for (REGION, PRODUCT) level groupings. In this scenario, each (REGION, PRODUCT) group in the Sales table always includes the time series variables from the Promotions table, and the analysis variables for the matching (REGION, PRODUCT) BY groups from the Returns table. So if ('SOUTH','EDSEL') is a BY group from the primary table, any matching rows from the Returns table are used to define the time series variables that are contributed from that table. The time series variables that are contributed by the Promotions table are always included in every BY group from the Sales table.
AUXDATA Alignment over the Time Dimension
The series from each BY group of the primary table defines a reference time span for the auxiliary tables. Only the intersection of the time span for each auxiliary series with the reference span is input. Leading or trailing missing values are added to the auxiliary series as required to create a time series that has the same span as the reference span. The leading or trailing missing values, if any, are then interpreted according to the value of the SETMISSING= option. For more information, see the SETMISSING= option in the ID statement and the SETMISSING= option in the VAR statement.
When time series are input from a single primary table, the values for all observations of all the time series are contained in the primary table, and no time series needs to be extended with leading or trailing missing values. However, when time series are input from both the primary table and an auxiliary table, the time series from the auxiliary table are truncated or extended as required if the span of the auxiliary series is not identical to the reference span.
For the preceding (REGION, PRODUCT) example, which includes a primary table and two auxiliary tables, consider how differences in the reference span from each BY group affect the time series input from the auxiliary tables in the following cases. In these cases:
Case 1:

In this case, : the auxiliary time span includes the reference span as a subset. Values in the AUXDATA series to the left of
and values to the right of
are truncated from the AUXDATA series. AUXDATA series values in
are input as their actual values. Any actual missing values are interpreted according to the value of the SETMISSING= option.
Case 2:

In this case, : the reference time span leads the auxiliary time span with a non-empty intersection. AUXDATA series values in
are extended with missing values, and then those missing values are interpreted according to the value of the SETMISSING= option. AUXDATA series values in
are input as their actual values. Any actual missing values are interpreted according to the value of the SETMISSING= option. AUXDATA series values in
are truncated.
Case 3:

In this case, : the reference time span lags the auxiliary time span with a non-empty intersection. AUXDATA series values in
are input as their actual values. Any actual missing values are interpreted according to the value of the SETMISSING= option. AUXDATA series values in
are extended with missing values, and then those missing values are interpreted according to the value of the SETMISSING= option. AUXDATA series values in
are truncated.
Case 4:

In this case, : the auxiliary time span is a subset of the reference time span. AUXDATA series values in
and values in
are extended with missing values, and then those missing values are interpreted according to the value of the SETMISSING= option. AUXDATA series values in
are input as their actual values. Any actual missing values are interpreted according to the value of the SETMISSING= option.
