Converting and Editing Unprintable Data - 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: For an Outstanding Payments report, the packed-decimal Amount Due field on a company’s invoice records is converted to printable format and edited with a floating dollar sign, commas, and a decimal point. In addition, to make the output easy to read, ten blanks are inserted between the Company Name field and the Amount Due field. (The following figure gives the input record layout.)

Figure 1. Input Record Layout

To sort the records and accomplish the conversion and editing, the following is coded.

Figure 2. JCL and Required Control Statements

The following figure shows the effect of OUTREC processing on the input record.

Figure 3. Post-OUTREC Record Layout

Explanation: First the records are sorted alphabetically by Company Name (1,23,CH). Next, OUTREC processing inserts 10 blanks (10X) between the Company Name field (1,23) and the Balance Due field (24,4,PD). OUTREC processing also converts this packed-decimal field to printable format and edits it with the user-provided pattern specified on the EDIT subparameter, EDIT=($II,IIT.TT). This pattern provides for a floating dollar sign as well as the appropriate comma and decimal point. The Is indicate that leading zeros should not be printed and the Ts indicate that zeros in those positions should be printed. Note that this conversion and editing of the data cause the length of the Balance Due field to increase from its original length of four bytes to ten bytes.