Chapter Contents |
Previous |
Next |
Working with Time Series Data |
Time intervals are specified in SAS Software using interval names like YEAR, QTR, MONTH, DAY, and so forth. Table 2.4 summarizes the basic types of intervals.
Table 2.4: Basic Interval TypesName | Periodicity |
---|---|
YEAR | Yearly |
SEMIYEAR | Semiannual |
QTR | Quarterly |
MONTH | Monthly |
SEMIMONTH | 1st and 16th of each month |
TENDAY | 1st, 11th, and 21st of each month |
WEEK | Weekly |
WEEKDAY | Daily ignoring weekend days |
DAY | Daily |
HOUR | Hourly |
MINUTE | Every Minute |
SECOND | Every Second |
Interval names can be abbreviated in various ways. For example, you could specify monthly intervals as MONTH, MONTHS, MONTHLY, or just MON. The SAS System accepts all these forms as equivalent.
Interval names can also be qualified with a multiplier to indicate multiperiod intervals. For example, biennial intervals are specified as YEAR2.
Interval names can also be qualified with a shift index to indicate intervals with different starting points. For example, fiscal years starting in July are specified as YEAR.7.
Time intervals are classified as either date intervals or datetime intervals. Date intervals are used with SAS date values, while datetime intervals are used with SAS datetime values. The interval types YEAR, SEMIYEAR, QTR, MONTH, SEMIMONTH, TENDAY, WEEK, WEEKDAY, and DAY are date intervals. HOUR, MINUTE, and SECOND are datetime intervals. Date intervals can be turned into datetime intervals for use with datetime values by prefixing the interval name with 'DT'. Thus DTMONTH intervals are like MONTH intervals but are used with datetime ID values instead of date ID values.
See Chapter 3 for more information about specifying time intervals and for a detailed reference to the different kinds of intervals available.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.