MFX is designed to improve programmer productivity by reducing the time the programmer/analyst must spend designing, testing, and debugging applications. With MFX’s extensive Data Utility and SortWriter features, data processing applications previously requiring several steps can be accomplished in a single execution.
MFX’s Data Utility features include a join facility, a multiple output facility, a full range of report writing capabilities, and a facility to create a PDF, RTF or HTML output file and e-mail it to one or more recipients. There are also many record selection and record reformatting facilities. These options allow you to design sort/merge/copy applications that can accomplish a host of related tasks.
Join Processing
The join facility, controlled by the JOINKEYS, JOIN, and REFORMAT control statements, joins records from two source files. When you join the records from two files, each record from the first file (the left side) with a given value in a specified field (the join key) is joined to each record from the second file (the right side) with the identical value in a specified field in that record. Thus, if m records from the left side have a given join key value, and n from the right side have the same join key value, the join results in m*n records with that join key value.
Specification of the placement of the data fields within the record created by the join operation is provided through the REFORMAT control statement. This allows you to specify which fields from the two records are to be placed in the joined record. Partially or completely missing fields will be filled into the resulting joined record by the use of a specified pad byte.
Record selection via the INCLUDE/OMIT parameter of the JOINKEYS statement eliminates records from either or both of the two input files prior to join processing.
Specification of whether the join input data is already sorted per the JOINKEYS control fields is controlled by the SORTED parameter on the JOINKEYS control statement. If the join input data set is already sequenced according to the specified JOINKEYS fields, the overall performance of the application improves.
Inner join, left outer join, right outer join, and full outer join are all supported through the use of the JOIN control statement.
Generating Multiple Output
The multiple output facility (OUTFIL) allows multiple output files to be generated with just one pass of the sort. Each of these files can have unique specifications that determine which records are to be included, how the records are to be formatted, and which report capabilities are to be used. Moreover, all these files can be written to the same output device, or each can be written to a different device.
Creating Reports
MFX’s SortWriter feature (OUTFIL) allows you to design comprehensive reports easily and efficiently. SortWriter options allow output data to be flexibly formatted with headers and trailers, which can include data fields. Various kinds of numeric results can be produced at report, page, and section levels. These include totals, subtotals, minimums, subminimums, maximums, submaximums, averages, subaverages, record counts, and subcounts. Output record fields can be realigned; the records can be padded with blanks, characters, and binary zeros; and numeric data can be converted and edited. Automatic pagination, page numbering, and dating are also provided.
Creating PDF, RTF, and HTML Files and E-mailing Them
The OUTFIL OUTPUT feature can be used to create an output file in PDF, RTF or HTML format. Any of these files can be e-mailed as an attachment to one or more recipients.
Selecting Records, Reformatting Records, and Summing Fields
Record selection, record reformatting, and summing are other important MFX Data Utility features. Record selection via the INCLUDE/OMIT feature permits certain records to be included or omitted from an input data set based on comparisons between two data fields or between a data field and a constant. Date data formats work with the CENTWIN option to ensure that century evaluation is applied to INCLUDE/OMIT comparisons involving 2-digit year data.
Record reformatting after input and/or before output, provided by the INREC/OUTREC capability, allows you to delete or repeat portions of records; insert spaces, characters, binary zeros, date constants and sequence numbers; realign fields; convert numeric data to its printable format; and convert data to its printable hexadecimal format. The CENTWIN option and date data formats enable conversion of 2-digit year fields to printable or packed decimal 4-digit years of the appropriate century. The ability to delete irrelevant fields before sorting via INREC can provide important performance benefits. Additionally, a variable-length record format input file can be converted into a fixed-length format output file or a fixed-length record format input file can be converted into a variable-length format output file.
The SUM feature allows records with equal sort control fields to be deleted and optionally sums numeric fields on those records. The deleted records can optionally be written to a separate data set.
The DUPKEYS feature provides all the facilities of the SUM feature plus the ability to replace specified numeric fields in the retained record with the minimum, maximum, or the average value of the field for all records with the same control field.
Sample SortWriter Report
The report below illustrates the versatility of MFX’s Data Utility and SortWriter features. First, irrelevant records are omitted from the input file and the input record is reformatted to eliminate unnecessary data fields. Then the file is sorted by invoice status and invoice date. The output record is reformatted for readability and the numeric fields are converted and edited. The report itself is divided into sections and subsections based on control field breaks. Headers and trailers identify the data fields, provide record counts and section and cumulative totals, and include the date and page number.
DB2 Query Support
MFX can directly retrieve data from a DB2 database based upon a user provided query. An SQL SELECT statement is used to specify the criteria of the request, and the query of the DB2 database will be in place of MFX's SORTIN or E15 processing. SORT or COPY, but not MERGE, functions can be used with DB2 queries. All MFX features that are performed after E15 processing are available for use with the DB2 query facility.
This feature improves performance over DB2’s DSNTIAUL program by allowing DB2 data to be passed directly into a SORT or COPY operation, without the use of setup steps or the need for user-written E15 exits. Refer to MFX DB2 Query Support for more information.