# Date Intervals, Formats, and Functions

### Shifted Intervals

Different kinds of intervals are shifted by different subperiods:

• YEAR, SEMIYEAR, QTR, and MONTH intervals are shifted by calendar months.

• WEEK and DAY intervals are shifted by days.

• SEMIMONTH intervals are shifted by semimonthly periods.

• TENDAY intervals are shifted by 10-day periods.

• YEARV intervals are shifted by WEEKV intervals.

• R445YR, R445QTR, and R445MON intervals are shifted by R445MON intervals.

• R454YR, R454QTR, and R454MON intervals are shifted by R454MON intervals.

• R544YR, R544QTR, and R544MON intervals are shifted by R544MON intervals.

• WEEKV intervals are shifted by days.

• WEEKDAY intervals are shifted by weekdays.

• HOUR intervals are shifted by hours.

• MINUTE intervals are shifted by minutes.

• SECOND intervals are shifted by seconds.

The INTSHIFT function returns the shift interval:

```interval = 'MONTH3.2';
shift_interval = INTSHIFT( interval );
```

In this example, the value of shift_interval is 'MONTH'. For more information about the INTSHIFT function, see the SAS Language Reference: Dictionary.

If a subperiod is specified, the shift index cannot be greater than the number of subperiods in the whole interval. For example, you can use YEAR2.24, but YEAR2.25 is an error because there is no 25th month in a two-year interval.

For interval types that shift by subperiods that are the same as the basic interval type, only multiperiod intervals can be shifted. For example, MONTH type intervals shift by MONTH subintervals; thus, monthly intervals cannot be shifted because there is only one month in MONTH. However, bimonthly intervals can be shifted because there are two MONTH intervals in each MONTH2 interval. The interval name MONTH2.2 specifies bimonthly periods that start on the first day of even-numbered months.