Sample OUTFIL Control Statements - 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 1

The following example illustrates how to use the OUTFIL control statement to define multiple output files.
Figure 1.  Sample OUTFIL Control Statement

The two OUTFIL control statements illustrated above are required to create two different output files.

  • The output records in the first file (SORTOF1) contain three fields from the input record. The first input record field begins in byte 1 and is 20 bytes long, the second input record field begins in byte 45 and is 5 bytes long, and the third input record field begins in byte 60 and is 8 bytes long. This file will include only those records with ‘NY’ in bytes 21 and 22 of the input record. These three fields will begin in bytes 10, 40, and 50 of the output record.

  • The output records in the second file (SORTOF2) contain two fields from the input record. The first input record field begins in byte 1 and is 20 bytes long, and the second input field begins in byte 60 and is 8 bytes long. This file will include only those records with ‘MA’ in bytes 21 and 22 of the input record. These two fields will begin in bytes 20 and 50 of the output record.

Example 2
Figure 2. Sample OUTFIL Control Statement

This OUTFIL control statement creates three identically formatted output files: SORTOF01, SORTOF02, and SORTOF03. These files may be written to the same output device or to three different output devices.

  • The output records contain two input record fields. The first input record field begins in column 1. This field began in position 1 before OUTREC processing and is 40 bytes long. The second input record field begins in column 50. This field began in position 41 before OUTREC processing and is 40 bytes long. The two fields will begin in positions 1 and 50 after OUTREC has been processed.

Example 3
Figure 3. Sample OUTFIL Control Statement with FTOV and VLTRIM

This OUTFIL control statement uses FTOV to convert fixed-length records to variable-length records and VLTRIM to remove the specified type of trailing bytes (in this case, asterisks).

The control statement would produce the following output:

Comprehensive examples illustrating the SortWriter facility and the multiple output capability of the OUTFIL control statement are provided in How to Use the MFX Data Utility Features.