An Enterprise Resource Planning system needs to keep track of your enterprise resources. Many of those resources, especially the expensive ones, need lots of documents tracked about them- inspections, service reports, maintenance bills, etc. So the ERP and the Document Management System need to talk.
Years ago, for Coyne, this presented a few problems. First, the ERP was a mainframe application running on an IBM mainframe. Second, it was getting retired. Third, the DMS didn't talk directly to it, but instead communicated through a terminal emulator and used configuration files to correctly parse the screen contents coming back from the mainframe.
The final, and key problem, was that, when examining the documents stored in the DMS, were that there were big confused piles of unrelated documents getting stored together. Specifically, if you looked for documents for the asset tagged 490, it'd fetch those, and also 49, 4900, 49000, or 490000. And vice versa, searches for 490000 would return all the other documents as well.
Now, within the mainframe, the same data might get displayed on multiple panels. So, for example, the tag for a requisition document might be displayed in
RQ01 on one panels,
RQ02 in another, and
RQ03 in yet another. And each of these fields could display the field differently, "depending on design, whim, programmer laziness and phases of the moon," as Coyne writes.
RQ01:  RQ02: [ 49] RQ03: [49 ]
Now, the DMS configuration file had a few flags meant to help parse this. For any field, you could set it to strip leading zeros, justify to the left, right or not at all, and whether or not to pad back with zeroes.
The people who designed the module for handling the "fixed assets" documents, the specific documents giving Coyne issues, opted to strip leading zeroes, justify left, and then fill back with zeroes. They deployed this solution, and it had been running for years.
Let's see how it handles common situations:
Key field ⇒ Normalized key [49 ] ⇒  [ 490] ⇒  [4900 ] ⇒   ⇒ 
Coyne sums it up:
Presto: document soup. Since there were a three-quarters of a million tags in fixed-assets, a whole lot of document soup.
This post originally appeared on The Daily WTF.