Previous Topic: Grouping Feature Example 1

Next Topic: Grouping Feature Example 3


Grouping Feature Example 2

Request

A report of CMS batch work run between 8 a.m. and 12 noon on Mondays ONLY, during the first quarter of 1994.

  1. Build CRITERIA statement to select 01/01/94 through 03/31/94.
  2. Build GROUP and GROUPC statements as follows:
                    points to Start Date
                    in VM Basic Accounting Table
                    │
                    │     points to Start Time (HH)
                    │     in VM Basic Accounting Table
                    │     │
                    │     │
                    │     │      points to batch
                    │     │     │run indicator
                    ▼     ▼     ▼
    
    BGROUP   0046 S0102 S2261 S
    
    S in the line above is the selection indicator
    
    BGROUPC  1870102           (1st Monday in quarter)
    BGROUPC  1870109           (2nd Monday in quarter)
              .                          .
              .                          .
              .                          .
    BGROUPC  1870327           (last Monday in quarter)
    
         8 a.m. through 12 noon
               ▼      ▼
    BGROUPC  208      11
    
              batch job indicator
              ▼
    BGROUPC  3B
    

Example 2 shows you how to use the grouping feature to selectively retrieve only those accounting records that qualify for selection. When you set the Selection/Rejection indicator on the GROUP statement to S, a record must pass all three criteria to be selected for further processing. Group #1 Definition requires the record to have a Start Date equal to that of an identified Monday in the first quarter.

If qualified, then Group #2 Definition requires the record to have a Start Time between 8 a.m. and 12 noon. If qualified, then Group #3 Definition requires the record to have the batch indicator set, showing that the work was performed in a CMS batch machine.

Any record failing one of the criteria is automatically rejected from further processing. The user could then define a SORT statement to sort on Start Date (major) and the hours position of Start Time (intermediate) to cause production statistics to come out hourly within date for each Monday in the first quarter.