Generating Several Output Files with Different Information - 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: Marketing wants three output files of customer records. The first will contain a list of U.S. and European customers. The second will contain a list of U.S. customers only, and the third will contain a list of European customers only.

To generate the three separate files, the following is coded.
Figure 1. JCL and Required Control Statements

Explanation: Creating the three requested output files requires coding three SORTOFxDD statements in the JCL: SORTOF1, SORTOF2, and SORTOF3 as well as three OUTFIL statements. Each of the OUTFIL statements is connected by a FILES parameter to one of the output files defined in the JCL. Specifying 1 on the FILES parameter connects its OUTFIL statement with the output file defined by the SORTOF1 DD statement in the JCL. Likewise, specifying 2 connects its OUTFIL statement with the output file defined by SORTOF2, and so on. The first output file will contain all the records from the input file (INCLUDE=ALL). The second output file will include only those records that contain the character string 'USA' beginning in byte 67, (INCLUDE=(67,3,CH,EQ,C'USA')), which indicates that these records are for USA customers. And similarly, the third output file will include only those records that contain the character string 'EUR' beginning in byte 67, which indicates that these records are for European customers.