Previous Topic: GROUPC Statement

Next Topic: Grouping Feature Example 2


Grouping Feature Example 1

Request

Report utilization by shifts where:

shift A = 8 am - 4 pm

shift B = 4 pm - 12 pm

shift C = 12 pm - 8 am

  1. Build GROUP and GROUPC statements as follows:

    points to hours position of Start Time field in VM Basic Accounting Table:

          select all records
                  V
    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:
    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 have been selected and assigned a Group Code according to which range the Start Time corresponds. The appropriate Group Code (A, B, or C) is placed in the Group #1 Code field in each record and subsequently used as a sort control field to produce totals for the three shifts.