Printing Maximum, Minimum and Average Data in Section Trailers - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
ContentType
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Topic type
How Do I
Copyright
2024
First publish date
2010
ft:lastEdition
2024-08-27
ft:lastPublication
2024-08-27T08:14:56.318001

Example: The section trailers for an accounts receivable report sectioned by data group (AAA, BBB, etc.) are to contain six edited numeric values for a 6-byte field that begins at byte 8 (8,6). The values to be printed are the following:

  • The minimum data value up to that point in the report (SUBMIN)

  • The minimum data value in the section (MIN)

  • The maximum data value up to that point in the report (SUBMAX)

  • The maximum data value in the section (MAX)

  • The average data value up to that point in the report (SUBAVG)

  • The average data value in the section (AVG)

Each value will be preceded, on the same line, by appropriate identifying text. Two columns of data will be printed.

To print the report, the following is coded:

Figure 1. Sample Code to Print Report

The following shows two sections from the report, with the resulting values for subminimums, minimums, submaximums, maximums, subaverages and averages:

Figure 2. Sample Report Sections

Explanation: The SECTION parameter generates a section break on field 1,3, which identifies data groups (AAA, BBB, etc.). The HEADER3 parameter defines section headers that print the label "GROUP" followed by the data group identifier. HEADER3 also defines two column headings: "SECTION," which identifies the column containing section numbers, and "VALUE," which identifies the columns containing the numeric data.

The TRAILER3 subparameters are SUBMIN, MIN, SUBMAX, MAX, SUBAVG and AVG. They specify the six values to appear in the section trailer. The values are all derived from the same field (8,6) and are suitably edited with mask M2 (8,6,ZD,M2).

The OUTREC parameter places the two data fields (5,2 and 8,6) in the report and edits the 8,6 field in the same way as for the six values in the section trailer (8,6,ZD,M2). The blank space placed at position 80 (80:1X) ensures that the output record is long enough to contain the header records.