Examples using REDUCE and REPORT
These examples show the effect of REPORT FROM and TO on REDUCE INTERVAL and BOUNDARY.
Example 1
ACCOUNTING
REDUCE
INTERVAL (60)
REPORT
FROM (, 9:00:00)
TO (,12:00:00)
In this example no GLOBAL command is in effect and no FROM and TO times are specified in the REDUCE subcommand, so all records in the input are reduced.
The REDUCE subcommand specifies that data is reduced at 60-minute intervals. By default, the boundary is set to 60. Data is gathered and consolidated every hour on the hour.
The Accounting data starts at 8:31:05. The INTERVAL begins on the hour. OMEGAMON for Db2 Performance Expert determines that the record at 8:31:05 falls into an interval beginning at 8:00:00 and sets the beginning interval time to 8:00:00.
Each additional Accounting record is read. The Accounting records at timestamps 8:31:05, 8:45:13, and 8:57:27 all fall into the interval beginning at 8:00:00. These three records are accumulated (added, subtracted, or whatever is appropriate for the given Accounting fields), consolidated, and stored by unique OMEGAMON for Db2 Performance Expert identifier sets (PRIMAUTH, PLAN, REQLOC, and so on) for the interval beginning at 8:00:00. Messages are written to the job summary report.
OMEGAMON for Db2 Performance Expert calculates the next interval at 9:00:00. Accounting records at 9:12:11, 9:15:00, 9:30:01, 9:32:00, 9:43:00, and 9:55:59 are accumulated, consolidated and stored for the interval beginning at 9:00:00. Messages are written to the job summary report.
No Accounting records are written during the period from 10:00:00 to 12:00:00, so no intervals are calculated and no messages are written to the job summary report.
Data is stored for the following intervals:
- Beginning at 8:00:00 - containing three Accounting records
- Beginning at 9:00:00 - containing six Accounting records
- Beginning at 12:00:00 - containing two Accounting records
- Beginning at 13:00:00 - containing six Accounting records
- Beginning at 15:00:00 - containing one Accounting record
- Beginning at 16:00:00 - containing eight Accounting records
The systems programmer requested a report with FROM and TO times of 9:00:00 and 12:00:00.
The data that is available for reporting is restricted by the FROM and TO times that are specified in both GLOBAL and REDUCE. If you specify FROM and TO dates and times in GLOBAL, OMEGAMON for Db2 Performance Expert discards all records outside those dates and times before reducing. If you specify FROM and TO dates and times in REDUCE, all records outside those dates and times are not available to subsequent REPORT subcommands. In this example, no GLOBAL command is in effect and no FROM and TO dates or times are specified in the REDUCE subcommand.
Accounting records that are stored in intervals beginning at or later than 09:00:00, but less than 12:00:00 are accumulated, consolidated, and reported in an Accounting report. In this instance, the report contains Accounting records from 09:12:11 to 09:55:59.
The report header contains the following times:
INTERVAL FROM 07/14/13 09:00:00
TO 07/14/13 10:00:00
REQUESTED ALL DATES 09:00:00
TO 12:00:00
INTERVAL FROM and TO times indicate the actual content of the report. In this instance, the INTERVAL FROM time is 9:00:00, which is the first interval beginning at or later than the REQUESTED FROM time. The INTERVAL TO time is 10:00:00, which is the end time of the last interval beginning at a time less than the REQUESTED TO time.
The REQUESTED FROM and TO times from the REPORT subcommand are printed in the report, even if they are broader than the available data. In this case, ALL DATES is reported in place of an actual date because no date was specified in the REPORT subcommand.
If the requested reporting interval is broader than the available data, the INTERVAL FROM and TO dates and times actually reflect the content of the report. If no FROM and TO dates and times are specified in the REPORT subcommand, the FROM and TO dates and times from GLOBAL are used. If no FROM and TO dates and times are specified in GLOBAL, NOT SPECIFIED is printed.
In Example 1, the INTERVAL FROM and TO times are not the same as the REQUESTED FROM and TO times. However, the data encompassed by the INTERVAL FROM and TO times is the same as the data encompassed by the REQUESTED FROM and TO times. This is not always the case, as in Example 2.
Example 2
ACCOUNTING
REDUCE
INTERVAL (60)
BOUNDARY (30)
REPORT
FROM (,9:00:00)
TO (,12:00:00)
This command is identical to the command in the Example 1, except that a BOUNDARY of 30 is included. The results are different.
- Beginning at 8:30:00 - containing five Accounting records
- Beginning at 9:30:00 - containing four Accounting records
- Beginning at 11:30:00 - containing two Accounting records
- Beginning at 12:30:00 - containing five Accounting records
- Beginning at 13:30:00 - containing one Accounting record
- Beginning at 15:30:00 - containing two Accounting records
- Beginning at 16:30:00 - containing seven Accounting records
An Accounting report is produced. The REQUESTED FROM and TO times are 9:00:00 and 12:00:00. Accounting records that are stored in intervals beginning at or later than 9:00:00, but less than 12:00:00, are included in the report. The intervals beginning at 9:30:00 and 11:30:00 are included in the report. No interval is calculated at 10:30:00 because there are no Accounting records.
In this instance, the report contains Accounting records from 9:30:01 to 12:17:54. Even though the REQUESTED FROM and TO times are the same as in Example 1, the content of the report is different.
The report header contains the following times:
INTERVAL FROM 07/14/13 09:30:00
TO 07/14/13 12:30:00
REQUESTED ALL DATES 09:00:00
TO 12:00:00
In both, Example 1 and Example 2), the INTERVAL FROM and TO dates and times are different from the REQUESTED FROM and TO times. However, this report contains data outside the REQUESTED FROM and TO times.
The INTERVAL FROM time is the start time of the first interval beginning at or after the REQUESTED FROM time (9:00:00 in this case), so the first interval that is reported starts at 9:30:00. Consequently, those records that are written between 9:00:00 and 9:30:00 are not included in the report.
The INTERVAL TO time is the end time of the last interval beginning before the REQUESTED TO time (12:00:00 in this case), so the last interval that is reported starts at 11:30:00. Consequently, those records that are written between 12:00:00 and 12:30:00 are included in the report. If the interval starts after the REQUESTED FROM time and before the REQUESTED TO time, all data from the interval is included, even if the interval extends beyond the REQUESTED TO time.
Example 3
Accounting
REDUCE
FROM (,09:30)
TO (,13:00)
INTERVAL (60)
BOUNDARY (60)
REPORT
FROM (,09:30)
TO (,13:00)
SAVE
In this example, no GLOBAL command is in effect, so the FROM and TO dates and times that are specified in REDUCE are used.
REDUCE specifies that data is reduced at 60-minute intervals. 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 (09:00).
The first interval starts before the FROM time, but only contains data between the FROM time (09:30) and the start time of the next interval (10:00).
The following intervals are calculated:
- Beginning at 09:00:00 - containing four Accounting records
- Beginning at 12:00:00 - containing two Accounting records
The interval begin and end times are reported in the job summary report.
The systems programmer requested a report with FROM and TO times of 9:30:00 and 13:00:00. Accounting records that are stored in intervals beginning at or later than 9:30:00, but less than 13:00:00 are accumulated, consolidated, and reported in an Accounting report. In this example, the report only contains Accounting records from the interval starting at 12:00:00.
All reduced records are written to the Save data set (including the records from the interval starting at 9:00:00 that were excluded from the report).
The report header contains the following times:
INTERVAL FROM 07/14/13 12:00:00
TO 07/14/13 13:00:00
REQUESTED ALL DATES 09:30:00
TO 13:00:00
The INTERVAL FROM and TO times reflect the actual content of the report. The INTERVAL FROM time is the start time of the first interval beginning at or after the REQUESTED FROM time (9:30:00 in this case), so the first interval that is reported starts at 12:00:00. The INTERVAL TO time is the end time of the last interval beginning before the REQUESTED TO time (13:00:00 in this case).
The REQUESTED FROM and TO times from the REPORT subcommand are printed in the report, even if they are broader than the available data. In this case, ALL DATES is reported in place of an actual date because no date was specified in the REPORT subcommand.
In this example, the INTERVAL FROM and TO times are not the same as the REQUESTED FROM and TO times, although the data encompassed by both sets of times is the same. However, the content of the Save data set is different from the content of the report.