## RANGE Statement

**RANGE** * variable [= first] [***TO** last ];

The RANGE statement specifies the range of observations
to be read from the DATA= data set.
For FIT tasks, the RANGE statement controls the period of
fit for the estimation.
For SOLVE tasks, the RANGE statement controls the
simulation period or forecast horizon.
The RANGE variable must be a numeric variable
in the DATA= data set that identifies the observations,
and the data set must be sorted by the RANGE variable.
The first observation in
the range is identified by *first*,
and the last observation is identified by *last*.

PROC MODEL uses the first *l* observations prior to
*first* to initialize the lags, where *l* is the maximum number
of lags needed to evaluate any of the equations
to be fit or solved, or the maximum number of lags
needed to compute any of the instruments when an
instrumental variables estimation method is used.
There should be at least *l* observations in the data set before *first*.
If *last* is not specified, all the
nonmissing observations starting with *first* are used.

If *first* is omitted, the first *l* observations are used to
initialize the lags, and the rest of the data, until *last*, is used.
If a RANGE statement is used but both *first* and *last *
are omitted, the RANGE statement variable is used to report the
range of observations processed.

The RANGE variable should be nonmissing for all observations.
Observations containing missing RANGE values are deleted.

The following are examples of RANGE statements:

range year = 1971 to 1988; /* yearly data */
range date = '1feb73'd to '1nov82'd; /* monthly data */
range time = 60.5; /* time in years */
range year to 1977; /* use all years through 1977 */
range date; /* use values of date to report period-of-fit */

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.