Batch reconciliation answers: do these two files agree? Finance asks whether the accounts payable sub-ledger matches the general ledger control account. Treasury asks whether bank statement entries match internal cash receipts. Operations asks whether the payment file matches open invoices. Easytrieve excels at sorted two-file compare: walk both files in key order, classify exact matches, flag amount variances, and list records present on only one side. Exception reports drive clerical research or automated retry before period close. This tutorial covers match key selection, merge-compare logic, amount tolerance, duplicate key policy, summary control pages, common banking and AP patterns, and sign-off when W-UNMATCH-CNT must be zero before downstream jobs run.
| File A | File B | Match key |
|---|---|---|
| GL sub-ledger detail | GL control summary | Account number |
| Bank statement | Cash receipts | Reference or check number |
| Open invoices | Payment file | Invoice number |
| Payroll register | Bank disbursement | Employee id + pay date |
| Inventory system | Warehouse snapshot | SKU + location |
1234567FILE FILEA MATCH-KEY 15 A AMT-A 11.2 FILE FILEB MATCH-KEY 15 A AMT-B 11.2
MATCH-KEY must sort identically on both files—same length, type, and padding rules. Amount fields may differ in name but must represent comparable values for variance check after key match. Align date in key when matching payments to daily batches.
Classic pattern uses GET or dual FILE read logic comparing keys. When FILEA key equals FILEB key, PERFORM MATCH-FOUND. When FILEA key less than FILEB key, FILEA orphan—A-not-B. When FILEA key greater, FILEB orphan—B-not-A. Advance the file with lower key and repeat until both EOF.
123456789101112MATCH-FOUND. PROC W-MATCH-CNT = W-MATCH-CNT + 1 IF AMT-A NE AMT-B W-VAR-CNT = W-VAR-CNT + 1 PERFORM PRINT-VARIANCE-LINE END-IF END-PROC ORPHAN-A. PROC W-ORPHAN-A-CNT = W-ORPHAN-A-CNT + 1 PRINT A-NOT-B-LINE END-PROC
Some implementations use single JOB with manual GET sequencing; others use MATCH macro or pre-merge SORT step producing match indicator file. Choose approach matching shop standards and maintainability.
Pennies differ due to rounding or timing. Define W-TOL-AMT from PARM—variance within tolerance counts as matched for operations but may still PRINT informational line for audit. IF ABS(AMT-A minus AMT-B) GT W-TOL-AMT treat as variance exception. Document tolerance in program header and runbook.
1234567TITLE 'RECONCILIATION CONTROL' 'FILE A READ:' W-READ-A-CNT 'FILE B READ:' W-READ-B-CNT 'MATCHED:' W-MATCH-CNT 'VARIANCES:' W-VAR-CNT 'A NOT B:' W-ORPHAN-A-CNT 'B NOT A:' W-ORPHAN-B-CNT
Identity check: W-READ-A-CNT should equal W-MATCH-CNT plus W-ORPHAN-A-CNT plus unmatched variance handling per policy when variance records still counted as matched keys. Operators verify before approving close.
Document policy explicitly—silent wrong match on duplicates causes costly financial errors.
Some closes require three sources—invoice, receipt, GL posting. Options: chain two Easytrieve jobs passing matched subset file, or one job with three-file extension comparing after pairwise match. Start with two-file mastery before designing three-way in single pass.
123456789//RECON EXEC PGM=EZTPA00,REGION=0M //SYSPRINT DD SYSOUT=* //SYSIN DD DSN=FIN.LIB(EZTRECON),DISP=SHR //FILEA DD DSN=FIN.SUBLED(+1),DISP=SHR //FILEB DD DSN=FIN.GLCTRL(+1),DISP=SHR //EXCEPT DD DSN=FIN.RECON.EX(+1),DISP=(,CATLG,DELETE) //PARM DD * 0.01 /*
Precede with SORT steps on MATCH-KEY for FILEA and FILEB. PARM passes tolerance amount 0.01 dollar.
Conditional JCL or scheduler rule: if W-ORPHAN-A-CNT plus W-ORPHAN-B-CNT plus W-VAR-CNT greater zero, set non-zero return code via STOP or RCODE assignment if shop uses Easytrieve exit for RC. Finance holds period close until exceptions cleared or approved with documented override ticket.
Reconciliation is like checking two lists of lunch orders to make sure every name on the class list paid the right amount. You line up both lists alphabetically. When names match, you check the money matches. When a name is on only one list, you ask why. At the end you count how many matched and how many problems need fixing before recess.
1. Batch reconciliation compares:
2. Both files must be sorted by match key because:
3. Unmatched record from file A only appears on:
4. Amount tie-out after key match checks:
5. Zero exception count often means: