Fixed Width Files

I work on a mainframe. One type of file commonly used is a fixed width file aka a flat file. These can be provided by the business to be used as input into processing or internal job processing.

These are plain text files without delimiters that contain one record per line. Data is arranged in rows and columns. They can be edited by a number of applications on a PC. I typically use Notepad ++ or Notepad depending on my mood.

Below is a simple fixed width file.

The last name always starts in position 1. It has a length of 8. The first name starts in position 9 for a length of 10. And so on. In COBOL, you can set up a copybook which defines the fields in the fixed width file. Once it’s set up, they can be shared across programs and used by utilities like FileAid or Star Tool to make it easier to read the file. I’ll post more about those in the future.

In my work, the business routinely provides additional data for processing in fixed width files. Sometimes it’s a list of accounts to exclude from a process or something more complicated. For example, say a country has a name change. The Netherlands Antilles dissolved and became Curaçao and Sint Maarten. The business provided a list of accounts and their new country.

The program would read this file, check the account number then used the provided new country name.

The first ‘computerized’ flat file database may be the paper hole punch extravaganza created by Herman Hollerith for the 1890 US Census. He invented a system of punched card data processing technology –  keypunch, sorter and tabular unit record machines – the 1880s. I have a book on the early hole punch work and it’s fascinating. That will be for another post.

These weren’t the first punch cards. Those were invented about 1750 for the use in the textile industry. Jacquard looms still clack on today creating intricate woven patters.

User Ghw on en.wikipedia, Public domain, via Wikimedia Commons

I never worked with flat file databases. They sound awfully fiddly and fragile. Fixed width files have long out grown punch card restraints. They are a convenient if old fashioned way for the business to provide data.


Posted

in

by

Tags:

Comments

Leave a comment