Previous Topic: The Output Phase (CULE)


The Processing Steps when an Extract File Is Read

CA Culprit performs the following steps when an extract file is read:

  1. Sends each detail extract record to the printer. Grand total break processing is performed at the end-of-file.
  2. Updates all subtotal accumulators.

    In our example, the detail values for AGE and EMPLOYEE-COUNT are added to all three accumulators. Since none of the other numeric fields from the type 5 line are referenced in type 6 or type 8 code, no other automatic totaling is performed. EMPLOYEE-COUNT serves as a counter because it always has a value of 1 on the type 5 line. It is not printed on the detail line of the report because position *000 (0000 will work too) is specified on the type 5 line, but it is still subtotaled.

  3. Looks ahead to the next detail extract record, searching its sort keys for a control break. If there is no control break, then it processes that next detail extract record (step 1 above).

    If there is a control break:

    If a control break occurs on more than one level at the same time, CA Culprit executes type 8 logic once for each level starting with the lowest level number first.

    In our example, when DEPARTMENT breaks, STATUS always has to break because it is a LEVL 1. Type 8 logic is executed for STATUS first.

  4. Executes control break spacing after exiting type 8 logic because of a TAKE or a DROP.

    If multiple control breaks occur, such as when DEPARTMENT and STATUS break together, the control break spacing is only performed for the highest level.

  5. Moves 0 to the accumulator for each field being totaled at the control break level being processed.
  6. Continues with step 1 (above) for the next record read from the extract file.
  7. Looks again to the next detail record from the extract file.
  8. Moves the values of any sort key fields on the record to an internal header control storage area if any of the sort key fields are coded on a type 4 parameter.