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