Grouping records
This section describes how to group records.
Usage
The record key for reduced data contains a number of OMEGAMON for Db2 PE identifiers. The identifiers contained in the key vary according to the report set.
When records are grouped, the set name of the records relating to grouped items is substituted for the original value of the specified identifier in the record key. When the substitution has been made, the records are not available for processing by using the original key values.
The following examples illustrate how sets are processed.
Example 1:
The following records are processed:Location | Connection ID | Correlation Name | Correlation Number | Plan Name | Primary Authorization ID |
---|---|---|---|---|---|
LOCATION_1 | TSO | USER_1 | 0 | PLAN_1 | ACCOUNTS |
LOCATION_1 | TSO | USER_1 | 0 | PLAN_1 | ACCOUNTS |
LOCATION_1 | TSO | USER_1 | 0 | PLAN_2 | ACCOUNTS |
LOCATION_1 | TSO | USER_1 | 0 | PLAN_3 | ACCOUNTS |
LOCATION_1 | TSO | USER_1 | 0 | PLAN_4 | ACCOUNTS |
//SYSIN DD *
GROUP (
PLANNAME (
PLANGRP (
PLAN_1
PLAN_2
PLAN_3
)
)
)
EXEC
This establishes a set named PLANGRP that you can use with INCLUDE or EXCLUDE on REDUCE and REPORT.
- You can use sets on GLOBAL(INCLUDE) to include records for grouped items.
No substitution takes place during preprocessing, but the input records for
the grouped items are included as if you entered each item. Note: When using sets on GLOBAL, remember that the GLOBAL INCLUDE or EXCLUDE specification becomes the default for all other commands in the job step. GLOBAL INCLUDE is illustrated in the following example:
The following records are available for further processing://SYSIN DD * GROUP ( PLANNAME ( PLANGRP ( PLAN_1 PLAN_2 PLAN_3 ) ) ) GLOBAL INCLUDE ( PLANNAME (G(PLANGRP)) ) EXEC
Table 2. Records grouped using GLOBAL(INCLUDE) Location Connection ID Correlation Name Correlation Number Plan Name Primary Authorization ID LOCATION_1 TSO USER_1 0 PLAN_1 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_1 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_2 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_3 ACCOUNTS - When you use the set name on REDUCE(INCLUDE), the set name is substituted
for the original value of the identifier in the key during REDUCE processing.
The reduced data contains only the grouped records. You cannot process data
by using the original key values in REPORT, and only the records for the set
are stored in the save data set.
//SYSIN DD * GROUP ( PLANNAME ( PLANGRP ( PLAN_1 PLAN_2 PLAN_3 ) ) ) GLOBAL INCLUDE ( PLANNAME (G(PLANGRP)) ) ACCOUNTING REDUCE INCLUDE (PLANNAME (G(PLANGRP))) SAVE EXEC
- When you use the set name on GLOBAL(INCLUDE), it acts as the default for
subcommands without an INCLUDE specification. The result for the following
example is the same as the result for the preceding example. The records are
grouped during REDUCE processing by using the GLOBAL(INCLUDE) default.
//SYSIN DD * GROUP ( PLANNAME ( PLANGRP ( PLAN_1 PLAN_2 PLAN_3 ) ) ) GLOBAL INCLUDE ( PLANNAME (G(PLANGRP)) ) ACCOUNTING REDUCE SAVE EXEC
The reduced data and the save data set contain the following record:
Table 3. Records grouped during REDUCE processing using the GLOBAL(INCLUDE) Location Connection ID Correlation Name Correlation Number Plan Name Primary Authorization ID LOCATION_1 TSO USER_1 0 PLANGRP ACCOUNTS - When you use the set name on REPORT(INCLUDE), the records for grouped
items are consolidated during report processing. In the following examples,
the REDUCE subcommand specification overrides the GLOBAL default. All records
that pass data filtering are included in the save data set because they are
not grouped during REDUCE processing.
//SYSIN DD * GROUP ( PLANNAME ( PLANGRP ( PLAN_1 PLAN_2 PLAN_3 ) ) ) GLOBAL INCLUDE ( PLANNAME (G(PLANGRP)) ) ACCOUNTING REDUCE INCLUDE (PLANNAME(*)) REPORT INCLUDE (PLANNAME(G(PLANGRP))) SAVE EXEC
In the following example, the set name on GLOBAL(INCLUDE) acts as the default for the REPORT subcommand. The result is the same as for the previous example.//SYSIN DD * GROUP ( PLANNAME ( PLANGRP ( PLAN_1 PLAN_2 PLAN_3 ) ) ) GLOBAL INCLUDE ( PLANNAME (G(PLANGRP)) ) ACCOUNTING REDUCE INCLUDE (PLANNAME(*)) REPORT SAVE EXEC
The Accounting report contains the following entry:
Table 4. Accounting report set Location Connection ID Correlation Name Correlation Number Plan Name Primary Authorization ID LOCATION_1 TSO USER_1 0 PLANGRP ACCOUNTS The save data set contains the following records:
Table 5. Save data for the accounting report set Location Connection ID Correlation Name Correlation Number Plan Name Primary Authorization ID LOCATION_1 TSO USER_1 0 PLAN_1 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_1 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_2 ACCOUNTS LOCATION_1 TSO USER_1 0 PLAN_3 ACCOUNTS
Example 2
In this example, two reports are generated. The first presents set items individually. In the second report, records are grouped. The REDUCE subcommand specification again overrides the GLOBAL default, so all records that pass preprocessing are included in the save data set.
//SYSIN DD *
GROUP (
PLANNAME (
PLANGRP (
PLAN_1
PLAN_2
PLAN_3
)
)
)
GLOBAL
INCLUDE (
PLANNAME (G(PLANGRP))
)
ACCOUNTING
REDUCE
INCLUDE (PLANNAME(*))
REPORT
INCLUDE (PLANNAME(*))
REPORT
INCLUDE (PLANNAME(G(PLANGRP)))
SAVE
EXEC
//SYSIN DD *
GROUP (
PLANNAME (
PLANGRP (
PLAN_1
PLAN_2
PLAN_3
)
)
)
GLOBAL
INCLUDE (
PLANNAME(G(PLANGRP))
)
ACCOUNTING
REDUCE
INCLUDE (PLANNAME(*))
REPORT
INCLUDE (PLANNAME(*))
REPORT
SAVE
EXEC