Using a Header to Eliminate Duplicate Information within 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
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

Example: Rather than repeat the department name and sales manager, which are identical for every record included in a section of the departmental sales report, marketing wants this information to appear only once-within the section headers of the report. Therefore, the section headers’ first two entries (Department and Sales Manager) will be drawn directly from the first data record in each section.

To print the section header with the input data fields, the following is coded.

Figure 1. JCL and Required Control Statements

The following figure shows the header that is generated by the above HEADER3 subparameter.

Figure 2. Sample Sections with HEADER3 Including Data from Input Record

Explanation: The HEADER3 subparameter on the SECTIONS parameter generates a header that prints at the beginning of each section. Its primary purpose here is to provide individualized section headings that contain the Department Name and the Sales Manager from the records in that section as well as labels for the columns of data. The first two entries in this header, 1:1.15 and 16:23,7 (the Department Name and Sales Manager, respectively), are drawn directly from the input record to eliminate the repetition of these fields in the detail lines of each section. Note that specifying these fields in the HEADER3 eliminates the need to include them in OUTREC processing as was necessary in the preceding example. Each of the number-colon entries (c:) specifies the column in which the entry following it should begin to print. Thus, the Department field, (1,15) begins to print in column 1; the Sales Manager field, in column 16; the literal string "SALES REP", in column 48, and so on. Blanks are automatically inserted in the space between the columns that are specified. It should be pointed out that on the OUTREC parameter a blank has been inserted in column 71 (71:C' ') so that the output record length will equal that of the header.