Totaling Data at the End of a Section - 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
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Topic type
How Do I
Copyright
2024
First publish date
2010
Last edition
2024-08-27
Last publish date
2024-08-27T08:14:56.318001

Example: The section trailer for an accounts receivable report sectioned by month is to contain the totals for the Amount Paid and the Balance Due columns of each section. These totals will appear directly below the columns of figures and be separated from them by strings of hyphens. An identifying label, TOTALS:, will appear on the same line as the totals and will begin in column 40.

To generate the trailer, the following is coded.
Figure 1. JCL and Required Control Statements

The following figure shows the section trailer, with totals, that is produced.

Figure 2. TRAILER3 with TOTAL

Explanation: In addition to generating strings of hyphens at the bottom of the columns to be totaled (65:10'-',86:10'-') and the identifying label TOTALS: on the line below (40:'TOTALS:'), the TRAILER3 provides for totaling the figures in the Amount Paid field (46,4,PD) and the Amount Due field (54,4,PD) on the invoice records. Note that because the TOT (TOTAL) entry is specified, the totals that appear at the end of each section represent that totals only for the records that are included in that section.

The totaled data for each field is converted to printable format and, after being edited, begins printing in the columns specified with the two number colon entries (c:), 65: and 86:.The data is edited by the EDIT pattern, ($II,IIT.TT), which suppresses the printing of leading zeros and inserts a floating dollar sign as well as the necessary comma and decimal point. The pattern uses an I to indicate the zeros in the total that should not be printed and a T to indicate those that should.