Example 1
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.
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.
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).
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.