Examples of interval calculation
These examples show how the REDUCE subcommand is used in combination with FROM, TO, INTERVAL, and BOUNDARY to align start times and intervals.
Using REDUCE to align to the start of the hour
REDUCE
FROM (,08:00)
TO (,10:00)
INTERVAL (30)
BOUNDARY (60)
BOUNDARY(60) aligns the start time of the intervals at the start of an hour, so the first interval starts at the FROM time (08:00). Subsequent intervals start every 30 minutes (08:30, 09:00, and 09:30 each day).
Using REDUCE to cover a day
REDUCE
INTERVAL (1440)
BOUNDARY (60)
The following defaults are applied:
- The default for FROM is all dates and a time of 00:00:00.00
- The default for TO is all dates and a time of 23:59:59.99
BOUNDARY(60) aligns the start time of the intervals at the start of an hour, so the first interval starts at the FROM time (00:00). Subsequent intervals cover 1 440 minutes or one day. An interval starts at 00:00 each day.
Using REDUCE to start every hour
REDUCE
FROM (,08:30)
TO (,12:00)
INTERVAL (60)
BOUNDARY (60)
REPORT
FROM (,08:30)
TO (,12:00)
BOUNDARY(60) aligns the start time of the intervals at the start of an hour, so the first interval starts at the hour of the FROM time (08:00). Subsequent intervals start every hour (09:00, 10:00, and 11:00).