The ABA file format, sometimes called Direct Entry or Cemtext, is an unpublished de facto standard for bulk electronic payments. It is used by all major Australian financial institutions to interface with business accounting systems, and is supported by many popular accounting packages such as MYOB. For small-to-medium businesses, the most common usage for an ABA file is to upload it via their Internet banking portal – to avoid manually entering transaction details into the web application. As the name suggests, the format is dictated by the Australian Banking Association, and also has ties with the Australian Payments Clearing Association (APCA).
I was recently tasked with writing an exporter from a proprietary, relational database system to the ABA format. Since the specifications for the file format are not in the public domain (at least, not from an official source), I had to rely on some third-party sources to arrive at a solution. In this article, i’ll share those resources with you, as well as providing my own explanation of some of the finer points of the standard – to help you avoid common pitfalls when working with the format.
Overview of the ABA format
The ABA format is somewhat archaic; certainly based on outdated technology. It’s a plain-text format that uses fixed-width fields (most of which are severely constrained, to the point that most data going into them must be truncated or abbreviated in order to fit). It is not supposed to be human-readable, although a trained eye can interpret it. Its values are untyped and there is nothing to validate the correctness of an ABA file if you are not privy to the rules.
An ABA file consists of:
- One ‘type 0’ record (i.e. line) which describes and provides instructions processing instructions for the batch
- One or more ‘type 1’ records which provide the detail for each payment in the batch
- One ‘type 7’ record which confirms the size and totals for the batch
(i.e. an ABA file is at least 3 lines long.)
Within each record/line in the file, and depending on the record type, there are a number of fixed-width fields which must be populated. Some are padded with zeroes, others with spaces. Some occupy the left portion of the field, others (like numeric fields) are right-justified. A complete line must consist of exactly 120 characters (excluding the CR/LF terminator). It’s helpful to write a function to perform the necessary padding/truncation and justification:
// requires a reference to System.Linq string ToFixedWidth(string input, int length, char padding = ' ', bool rightJustify = false) { char[] output = new char[length]; if (rightJustify) input = new string(input.Reverse().ToArray()); for (int i = 0; i < length; i++) { if (i < input.Length) output[i] = input[i]; else output[i] = padding; } if (rightJustify) output = output.Reverse().ToArray(); return new string(output); } // to pad a string out to 18 characters, left-justified and padded with spaces: ToFixedWidth(str, 18); // to pad a decimal number out to 10 characters, right-justified and padded with zeroes: ToFixedWidth((num * 100).ToString("0000000000"), 10, '0', true);
Some additional notes:
- Most examples i’ve seen capitalise all text fields, however this is not necessary. Some financial institutions will retain the casing of your narrations/annotations, if only on the sender’s bank statement.
- All dollar amounts are expressed in whole cents, with no digit grouping. Multiply your decimal figures by 100 and use an appropriate number format string (e.g. “0000000000”).
Resources for the file format specification
The following are two excellent resources for the specification of the ABA file format itself:
- Blue Chilli’s specification for the ABA file format
- David Klein’s specification for the ABA file format
Between these two documents, you should have all the information you need to construct the ABA records themselves. There is some inherent ambiguity in these, however, which is why i’d like to add the following notes:
Descriptive record
Reel sequence number
There is a maximum number of payments you can include per ABA file, if only because the dollar amount and number of records fields are of a fixed length. If you need to split your batch into multiple files, the reel sequence number identifies each one. However, in the vast majority of cases, you will only have one file, numbered 01. You do not have to keep track of which numbers you have used previously.
User Preferred Specification
This is one of two pieces of information that identify the user and their financial institution. Some banks will dictate the value for this field, others are less restrictive and will permit any form of the name on the user’s bank account. It’s best to make the value for this field user-maintainable.
User Identification Number
Contrary to its description, this number identifies the financial institution, not the user. Each FI has its own number (or possibly several, depending on the size of the bank) which is issued by APCA. This number does not change between batches; it’s tied to the bank and, potentially, the account. Most banks document this number somewhere in their internet banking portal instructions.
Detail records
Indicator
As far as I can tell, this field can be used to indicate that a particular record represents a change to a prior record in the batch, or to existing details held on file for the payee. It’s also clear that not every financial institution pays attention to this field. Unless you are dealing with thousands of payments at a time, you should leave this field blank to make it clear that each record represents a separate payment.
Transaction code
In most cases, you should use the code 50, which represents a non-specific credit to the bank account. For payroll transactions, use the code 53. The other transaction codes appear to be of relevance to the ATO and superannuation funds only.
Lodgement reference
This is the text that appears on the payee’s bank statement.
Trace record (BSB and Account No)
This is the BSB and Account Number of your bank account.
Name of remitter
If your bank supports it, this lets you track the name of the person in your organisation who authorised the payment.
Final words
Hopefully, this points you in the direction of the right resources and helps to dispel some of the confusion surrounding the ABA file format. By following the specification exactly, you will produce a file that can be read by all major Australian banks and has the potential to save time and reduce errors when processing large numbers of payments.
See also
ABA/Cemtext Validator – An ABA file validator and SDK based on this article