Friday, January 4, 2013

ANSI X12 EDI 822

For commercial domestic (US) account analysis, most companies receive what is called an ANSI X12 EDI 822 file from their financial institution(s).

What is ANSI X12?  ANSI stands for the American National Standards Institute.  X12 is a standard transaction set used mostly in North America.  Its format consists of loops, delimiters, and segment terminators.  Various sections of an ANSI X12 file have their own "label" such as the ISA/ISE, the GS/GE, or the ST/SE envelopes.  The "/" for each relationship indicates a header/trailer grouping. 

So, for an 822 file, the ISA envelope heads the file while the IEA envelope trails it.  The same goes for GS/GE and ST/SE.  I've had success keeping the headers and trailers straight by remembering the "E" trails; since ISE, GE, and SE all have the letter "E" while ISA, GS, and ST do not. 

Lastly, EDI means Electronic Data Interchange; an electronic format of what would otherwise be a paper statement. I like to highlight the first letter of each word in an acronym so I can visually see how the acronym came about. I've come across many an acronym where I've thought to myself, "Really?! That's the best you guys could come up with from this??"

The 822 is one of many transaction sets available but the only one used specifically for account analysis.

Commercial Account Analysis = ANSI X12 EDI 822.


An 822 file is usually delivered in a .txt, doc, .docx, or .822 format.  From my time in account analysis, I've only worked with two versions of the 822 file; the 3040 and the 4010.  There may be versions prior to the 3040 and there may be versions after the 4010.  I don't concern myself with it until it falls on my desk or in my inbox. 

In an 822 file, the company should receive information about their account balances, service charges, bank fees, adjustments/credits, rates, as well as any earned credit in the form of an earnings allowance.  Some of this information falls between the header/trailer envelopes and are preceded by account records. 

The segments denoting an account usually include the account name, account number, and account level.  Following an account segment, you should see charges and compensations for the balances of that particular account followed next by specific service activity information for this account.   Know that each new account segment begins an account record so the presence of the next account segment signifies the end of the previous record.

In addition to the company's breakdown of fees and charges, one can also find other information such as the date when the file was produced, the time period for which the data of the file relates, the bank's routing transit number (RTN), the bank's location, etc.  This information is usually found at the beginning of the file following the header/trailer envelopes.  If there is more than one bank RTN present in the 822 file, there should be a separate ISA/ISE envelope indicating that the first file has ended and a new file with data relating to a different RTN is beginning. 

Contrary to what it appears, there is an order to the data which can easily be seen by "unwrapping" the 822 file.  Most, but not all, EDI 822 files are delivered "wrapped" which means it consists of one continuous string of data that is not separated by any identifiable break point. However, if you "unwrap" an 822 file you can easily identify the header/trailer envelopes as well as the data itself.

To "unwrap" means to break up the one continuous string of data and place each individual segment at the start of its own line in the file. This allows you to read it from left to right in some kind of order. The steps I've learned to unwrap an 822 file are found using Microsoft Word. 
  1. Ctrl A
  2. Ctrl H
  3. Type ^p in the Find what field, leave the Replace with field blank, and then select Replace All.
  4. Type the file's segment terminator in the Find what field. Then, type the file's segment terminator and ^p (no space) into the Replace with field.  Select Replace All
Step 1: this highlights the entire document.

Step 2: this opens the "Find and Replace" feature in MS Word.

Step 3: for this step, leave the "Replace" field blank. After you select "Replace All"   you will get a pop-up window telling you the number of rows affected and if you want to continue the same for the entire document.

Step 4: the segment terminator literally terminators the segment. It's like a period in a regular everyday sentence; the end of a statement, thought, phrase, etc. Most segment terminators are "\" or "~". For untrained eyes, finding it is the issue.  So, for this step, your Replace with field may look like this: ~^p

Once complete, you should be able to read the 822 file from left to right per line. If you cannot, you did something wrong so try again.

Happy Analyzing! 

No comments:

Post a Comment