Obtaining a Cumulative (Running) Count of Data Records - 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: For an outstanding invoices report sectioned by month, marketing wants a cumulative, or running, count of invoices to date at the end of each section as well as a total count of each month’s invoices included as section trailers.

To generate these record counts, the following is coded.

Figure 1. JCL and Required Control Statements

The following figure shows the trailers containing the counts of records.

Figure 2. TRAILER3 Containing Record Counts and Cumulative Record Counts

Explanation: The trailer’s first / entry causes the printer to leave one blank line after the data records and before printing the trailer. The second / entry indicates the end of the trailer’s first line. The identical number-colon entries (95:) set the starting positions of the literal strings that follow them: 'MONTH' 'S NUMBER OF INVOICES: ' and 'NUMBER OF INVOICES TO DATE: '.(Note that the apostrophe in MONTH'S is doubled because a single apostrophe would signal the end of a literal string.) Finally, because each data record in this report represents an invoice, the TRAILER3’s COUNT entry generates a count of each month’s invoices and the SUBCOUNT entry generates a cumulative, or running, count of the invoices. The leading zeros in these 8-byte fields are suppressed.