2.4 Batch Control (Type 8), File Control (Type 9) & Entry Hash Calculations
Key Takeaways
- The Batch Control Record (Type 8) and File Control Record (Type 9) seal the transmission envelopes and provide mathematical verification of data integrity.
- The Batch Entry Hash is calculated by summing the 8-digit Receiving DFI routing numbers of all Type 6 records in the batch, retaining only the rightmost 10 digits upon overflow (Modulo 10^10).
- The File Entry Hash is calculated by summing the 10-digit Entry Hashes of all Type 8 records in the file, truncating any overflow beyond 10 digits to the rightmost 10 digits.
- The Block Count in the Type 9 record is calculated as ceil(Total Active Records / 10), accounting for headers, batches, controls, and any trailing nines padding records.
- ACH Operators execute immediate automated balance validation of entry counts, debit/credit totals, and entry hashes upon ingestion; any discrepancy triggers fatal batch or file rejection.
2.4 Batch Control (Type 8), File Control (Type 9) & Entry Hash Calculations
Control records serve as the cryptographic and arithmetic seals of the ACH Network. Without control records, electronic transmission errors, dropped packets, or fraudulent record injections could silently corrupt banking ledgers.
The Company/Batch Control Record (Type 8) summarizes and seals individual batches, while the File Control Record (Type 9) summarizes and seals the entire ACH file. ACH Operators execute strict, automated balance checks against these records before routing transactions for clearing.
Field-by-Field Specification: Batch Control Record (Type 8)
| Field | Positions | Length | Type | Name | Contents / Validation Rules |
|---|---|---|---|---|---|
| 1 | 01–01 | 1 | N | Record Type Code | Mandatory constant 8. Identifies record as Batch Control. |
| 2 | 02–04 | 3 | N | Service Class Code | Must identically match Field 2 of corresponding Type 5 record (200, 220, 225, 280). |
| 3 | 05–10 | 6 | N | Entry / Addenda Count | Total count of all Type 6 Entry Detail records PLUS all Type 7 Addenda records in this batch. |
| 4 | 11–20 | 10 | N | Entry Hash | Calculated 10-digit sum of all 8-digit Receiving DFI routing numbers in this batch (truncated to 10 digits). |
| 5 | 21–32 | 12 | N | Total Debit Entry Dollar Amount | Sum of all debit amounts in batch, in cents, zero-padded (12-digit amount in cents). |
| 6 | 33–44 | 12 | N | Total Credit Entry Dollar Amount | Sum of all credit amounts in batch, in cents, zero-padded (12-digit amount in cents). |
| 7 | 45–54 | 10 | A/N | Company Identification | Must identically match Positions 41–50 of corresponding Type 5 record. |
| 8 | 55–73 | 19 | A/N | Message Authentication Code (MAC) | Optional 19 characters. Security authentication code for high-value/governmental files (usually blank). |
| 9 | 74–79 | 6 | A/N | Reserved | 6 blank spaces ( ). Reserved for future Nacha use. |
| 10 | 80–87 | 8 | N | Originating DFI Identification | Must identically match Positions 80–87 of corresponding Type 5 record. |
| 11 | 88–94 | 7 | N | Batch Number | Must identically match Positions 88–94 of corresponding Type 5 record. |
Field-by-Field Specification: File Control Record (Type 9)
| Field | Positions | Length | Type | Name | Contents / Validation Rules |
|---|---|---|---|---|---|
| 1 | 01–01 | 1 | N | Record Type Code | Mandatory constant 9. Identifies record as File Control. |
| 2 | 02–07 | 6 | N | Batch Count | Total number of Type 5 records (batches) contained in the entire file. |
| 3 | 08–13 | 6 | N | Block Count | Total number of 10-record physical blocks in the file, including headers, controls, and nines padding. |
| 4 | 14–21 | 8 | N | Entry / Addenda Count | Total cumulative count of all Type 6 and Type 7 records across all batches in the file. |
| 5 | 22–31 | 10 | N | Entry Hash | Sum of the 10-digit Entry Hashes from all Type 8 records, truncated to rightmost 10 digits. |
| 6 | 32–43 | 12 | N | Total Debit Dollar Amount in File | Total cumulative sum of all debits in the file, in cents, zero-padded (12-digit amount in cents). |
| 7 | 44–55 | 12 | N | Total Credit Dollar Amount in File | Total cumulative sum of all credits in the file, in cents, zero-padded (12-digit amount in cents). |
| 8 | 56–94 | 39 | A/N | Reserved | 39 blank spaces. Reserved for future Nacha use. |
Mathematical Mechanics of the Entry Hash
The Entry Hash is a critical mathematical checksum designed to detect corrupted, missing, transposed, or injected routing numbers during data transmission.
Batch Entry Hash Algorithm
- For every Type 6 Entry Detail Record in the batch, extract the 8-digit Receiving DFI Identification (Positions 04–11). Do NOT include the 9th check digit (Position 12).
- Add all 8-digit routing numbers together using standard arithmetic addition.
- If the sum is 10 or fewer digits, format the result with leading zeros to fill exactly 10 character positions.
- The 10-Digit Overflow Truncation Rule: If the sum exceeds 10 digits (i.e., reaches 10,000,000,000 or greater), truncate the leftmost overflowing digits and retain only the rightmost (least significant) 10 digits (Modulo $10^{10}$).
File Entry Hash Algorithm
To compute the Entry Hash for the Type 9 File Control record, sum the 10-digit Entry Hash values of every Type 8 Batch Control record in the file, applying the same 10-digit rightmost truncation rule:
Step-by-Step Worked Mathematical Examples
Scenario 1: Standard Batch Calculation (No Overflow)
An ODFI batches 4 payroll credit entries (PPD, Service Class Code 220):
- Entry 1: RDFI Routing
071000013(Pos 04–11 =07100001), Amount = $1,500.00 (0000150000in cents) - Entry 2: RDFI Routing
121000358(Pos 04–11 =12100035), Amount = $2,250.50 (0000225050in cents) - Entry 3: RDFI Routing
021000021(Pos 04–11 =02100002), Amount = $875.25 (0000087525in cents) - Entry 4: RDFI Routing
091000019(Pos 04–11 =09100001), Amount = $3,100.00 (0000310000in cents)
Calculations:
- Entry Count: 4 Type 6 records + 0 Type 7 records =
000004(Pos 05–10) - Debit Dollar Total:
000000000000($0.00 in cents, Pos 21–32) - Credit Dollar Total:
- Batch Entry Hash:
Scenario 2: High-Volume Commercial Batch (With 10-Digit Overflow)
A large corporate origination batch contains 250,000 debit entries. Standard addition of all 250,000 8-digit routing numbers produces:
Truncation Calculation:
- Identify the rightmost 10 digits:
9283741290. - Discard the 4 leftmost overflowing digits (
1845). - Value placed in Positions 11–20 of Type 8:
9283741290.
Scenario 3: Multi-Batch File Control Accumulation
Suppose an ACH file contains two batches:
- Batch 1 (Scenario 1): Batch Hash =
0030410039, Debits = $0.00 (000000000000), Credits = $7,725.75 (000000772575), Entry Count = 4 - Batch 2 (Scenario 2): Batch Hash =
9283741290, Debits = $14,500,000.00 (001450000000), Credits = $0.00 (000000000000), Entry Count = 250,000
File Control (Type 9) Field Values:
- Batch Count (Pos 02–07):
000002(2 batches) - Entry / Addenda Count (Pos 14–21):
00250004(250,004 total detail records) - Total Debit Dollar Amount (Pos 32–43):
001450000000($14,500,000.00 in cents) - Total Credit Dollar Amount (Pos 44–55):
000000772575($7,725.75 in cents) - File Entry Hash (Pos 22–31):
Block Count Calculation Formula
The Block Count field (Positions 08–13 of Type 9) verifies that physical blocks were not truncated during transmission.
Worked Example: Block Count
In our two-batch file above:
- 1 File Header (Type 1)
- 2 Batch Headers (Type 5)
- 250,004 Entry Details (Type 6)
- 0 Addenda Records (Type 7)
- 2 Batch Controls (Type 8)
- 1 File Control (Type 9)
Since 250,010 is an exact multiple of 10, zero nines padding records are required.
An ACH batch contains three Entry Detail records with the following RDFI routing numbers: 071000013, 121000358, and 021000021. What is the correct 10-digit Entry Hash to be populated in Positions 11–20 of the Batch Control Record (Type 8)?
If the arithmetic sum of the 8-digit Receiving DFI routing numbers in a high-volume ACH batch equals 14,892,345,678, what Entry Hash value is placed in the Type 8 Batch Control record?
An ACH file contains 1 File Header, 1 Batch Header, 42 Entry Detail Records, 0 Addenda Records, 1 Batch Control, and 1 File Control record. What is the correct Block Count reported in Positions 08–13 of the File Control Record (Type 9)?
What action does an ACH Operator take if the calculated sum of credit amounts in an ACH batch does not match the Total Credit Entry Dollar Amount in Positions 33–44 of the Type 8 Batch Control Record?