Returns the length of the seasonal cycle when a date, time, or datetime interval is specified.

Category: | Date and Time |

specifies a character constant, a variable, or an expression that contains an interval name such as WEEK, MONTH, or QTR. Interval can appear in uppercase or lowercase. The possible values of interval are listed in Intervals Used with Date and Time Functions in SAS Language Reference: Concepts..

Multipliers and shift
indexes can be used with the basic interval names to construct more
complex interval specifications. The general form of an interval name
is as follows:

The three parts of the interval name are as follows:

specifies the name of the basic interval type. For example, YEAR specifies yearly intervals.

specifies an optional multiplier that sets the interval equal to a multiple of the period of the basic interval type. For example, the interval YEAR2 consists of two-year, or biennial, periods.

See | Incrementing Dates and Times by Using Multipliers and by Shifting Intervals for more information. |

specifies an optional shift index that shifts the interval to start at a specified subperiod starting point. For example, YEAR.3 specifies yearly periods shifted to start on the first of March of each calendar year and to end in February of the following year.

Restrictions | The shift index cannot be greater than the number of subperiods in the whole interval. For example, you could use YEAR2.24, but YEAR2.25 would be an error because there is no 25th month in a two-year interval. |

If the default shift period is the same as the interval type, then only multiperiod intervals can be shifted with the optional shift index. For example, because MONTH type intervals shift by MONTH subperiods by default, monthly intervals cannot be shifted with the shift index. However, bimonthly intervals can be shifted with the shift index, because there are two MONTH intervals in each MONTH2 interval. For example, the interval name MONTH2.2 specifies bimonthly periods starting on the first day of even-numbered months. | |

See | Incrementing Dates and Times by Using Multipliers and by Shifting Intervals for more information. |

specifies a number or a cycle.

This argument enables
you to have more flexibility in working with dates and time cycles.
If there is a 53-week year,
you can easily determine the seasonality by using 53 as the value
for seasonality, as the following
example shows:

`INTSEAS('WEEK', 53);`

. By default, `INTSEAS('WEEK');`

equals 52.
Example | The function INTSEAS('interval', seasonality);returns a number when you specify a numeric value for seasonality. The function INTSEAS('MONTH', ‘QTR');returns a value of 3 when you specify the QTR cycle. |

The INTSEAS function
returns the number of intervals in a seasonal cycle. For example,
when the interval for a time series is described as monthly, then
many procedures use the option INTERVAL=MONTH. Each observation in
the data then corresponds to a particular month. Monthly data is considered
to be periodic for a one-year period. A year contains 12 months, so
the number of intervals (months) in a seasonal cycle (year) is 12.

Quarterly data is also
considered to be periodic for a one-year period. A year contains four
quarters, so the number of intervals in a seasonal cycle is four.

The periodicity is not
always one year. For example, INTERVAL=DAY is considered to have a
period of one week. Because there are seven days in a week, the number
of intervals in the seasonal cycle is seven.

For more information
about working with date and time intervals, see Date and Time Intervals .

The retail industry
often accounts for its data by dividing the yearly calendar into four
13-week periods, based on one of the following formats: 4-4-5, 4-5-4,
or 5-4-4. The first, second, and third numbers specify the number
of weeks in the first, second, and third month of each period, respectively.
For more information, see Retail Calendar Intervals: ISO 8601 Compliant in SAS Language Reference: Concepts.

Seasonality is a time
series concept that measures cyclical variations at different intervals
during the year. In specifying seasonality, the time of year is the
most common source of the variations. For example, sales of home heating
oil are regularly greater in winter than during other times of the
year. Often, certain days of the week cause regular fluctuations in
daily time series, such as increased spending on leisure activities
during weekends. The INTSEAS function uses the concept of seasonality
and returns the length of the seasonal cycle when a date, time, or
datetime interval is specified. For more information about seasonality
and forecasting, see the SAS/ETS User's Guide.

Copyright © SAS Institute Inc. All rights reserved.