Sample MFX DB2 Query Application - 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
ContentType
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Topic type
How Do I
Copyright
2024
First publish date
2010
ft:lastEdition
2024-08-27
ft:lastPublication
2024-08-27T08:14:56.318001

In this example, a query is made for employee data. The example specifies how the application is to sort and format the data into a report. The formatting adds headers, field spacing, and converts a date to printable forms.

Figure 1. Sample MFX DB2 Query Application

The following describes the JCL statements:

  • The EXEC statement identifies SYNCSORT as the program to be executed. The DB2 PARM defines the DB2 subsystem to be accessed.

  • The STEPLIB DD statement instructs the system as to where the MFX and DB2 products can be found.

  • The SYSOUT DD statement assigns the MFX messages to the output device associated with SYSOUT class A.

  • The SORTOF1 DD statement gives OUT1 as the output data set name and specifies a 3390 disk. One cylinder of primary space has been allocated on this volume. The DISP parameter shows that this data set is not yet in existence.

  • The two SORTWK statements reserve space on four temporary data sets for inter-mediate storage. Twenty cylinders are to be reserved on the data sets.

  • The SORTDBIN DD statement marks the beginning of the input stream that contains the SQL SELECT statement that describes the criteria of the query.

  • The SYSIN DD statement marks the beginning of the input stream that includes the sort control statements. A sort will be performed and a report will be generated. The records read from the DB2 database under control of the query specified in the SORTDBIN data set will be formatted and presented in this report. Fields will be converted to printable format when necessary.

The SYSOUT will contain a report on the execution of the application. The report displays the control statements followed by the query record layout and MFX messages with information on the particular execution. The following is a sample report:

Figure 2. Sample SYSOUT Report

 

The following shows the output from the application:
Figure 3. Sample Application Output