Previous Topic: GROUPC Statement

Next Topic: Grouping Feature Example 2


Grouping Feature Example 1

Request:

Report utilization by shifts where:

  1. Build GROUP and GROUPC statements as follows: point to hours position of Reader Start Time field (010) for a length of 2 bytes (as defined in the Basic Accounting Table): :lp.
    position   1         2         3         4         5                 8
      1........0.........0.........0.........0.........0..            ...0
        select all records
                ▼
      AGROUP   0102                }
      AGROUPC  108      15      A  } Shift A
      AGROUPC  116      23      B  } Shift B
      AGROUPC  100      07      C  } Shift C
    
  2. Build SORT statement to sort on Group #1 code field in accounting record.
  3. DESCRIPT statements could then be used to associate group codes with literals as follows: :lp.
    position   1         2         3         4         5                 8
      1........0.........0.........0.........0.........0..            ...0
      ADESCRIPT0A       FIRST SHIFT
      ADESCRIPT0B       SECOND SHIFT
      ADESCRIPT0C       THIRD SHIFT
    

    Example 1 shows you how to use the grouping feature without employing the record selection/rejection option. All records are selected and assigned a group code according to the range in which their reader start time falls. The appropriate group code (A, B, or C) is placed in the Group #1 code field in each record and then used as a sort control field to produce totals for the three shifts.