Including Relevant Records - 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
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

Example: A school board requires a list of all students performing below their grade level on standardized exams. (The record layout is given in the figure Input Record Layout and a sample record is given in the figure Sample Student Record.)

Figure 1. Input Record Layout

Figure 2. Sample Student Record

To generate the list, the following is coded:
Figure 3. JCL and Required Control Statements

Explanation: In this application, two comparisons are necessary to identify the records needed for the list: the Grade field (25,2) has to be compared to the student’s Reading Score field (27,2) and to the Mathematics Score field (29,2). All numeric fields on the student records are in packed-decimal (PD) format.

The two-clause INCLUDE statement (see figure JCL and Required Control Statements) guarantees the selection of the needed records from the file. The first clause (29,2,LT,25,2) guarantees that records with Math Scores less than the Grade field are INCLUDED. The second clause (27,2,LT,25,2) guarantees that records with Reading Scores less than the Grade field are also INCLUDED. The OR connecting the two clauses guarantees that if either or both of the scores are less than the Grade field, the record is selected. Finally, since all the fields are in packed-decimal format (PD), FORMAT=PD is specified.

The sample record shown above will be INCLUDED because the student’s Math Score (047F) is lower than the Grade level (050F).