- In the PREPARE block, set up Local variables required for the WRITE function.
- In the WRITE1 and WRITE2 blocks
- specify the input file
- specify the lines to be searched (.AL. indicates all lines)
Use DO EXTRACT statements to extract the check number and check amount (from their respective locations in the two files).
Use the DO CALLUSER statement to invoke the WRITE function.
- In block MERGEX
Use DO CALLUSER statement to invoke the MERGEX function that compares the two files prepared in the two previous blocks.
- The RESULT block prints unmatched records found by the MERGEX function:
Scan all records in the file referenced by the SRECOUT1 DD statement. This file contains all of the unmatched records found by the MERGEX Reconciliation function.
For each unmatched record:
- Extract the check number.
- Extract the check amount.
- Extract the file indicator (1 or 2) that provides information about the type of problem.
- Print all of the extracted fields.
- Block END always terminates the rule with status OK and a condition code of zero.