Rockn
Rockn

Reputation: 47

Importing COBOL Data Into SQL

I am not even sure where to begin with this one. Our old accounting system used Cobol and flat files as a database. I was wondering if there was any way to import all of this into SQL and making it useful. Ideally I would like to get to a point where I could import this historical data into our ERP. The header in one of the files shows a RMKF entry and I also see some Cobol dll files on the server like Cob32api.dll Any insight appreciated.

Upvotes: 1

Views: 2985

Answers (1)

Bruce Martin
Bruce Martin

Reputation: 10553

Directly no. Any answer will be determined on which Cobol Dialect you have (I would guess RM Cobol). Some of the Cobol compilers have there own File System. You may need to unload the files

In general while some Cobol files will be suitable for loading into a Database. Other will require programming:

  • Multi-Record files - probably split in to several different tables
  • Files with redefines

Accessing the data in the files

Loading the Files into a Database is either going to be expensive or time consuming (or both):

  1. There are some commercial that provide access to Cobol Files (I would imagine they are expensive). Googling revealed: http://www.cobolproducts.com/datafile/data-viewer.html popup. But you will still need to analyse the files. Things like redefines can cause issues.

  2. look at this answer Dynamically Reading COBOL Redefines with C# It looks to be similar problem, Thomas used cb2xml to generate the Cobol.

  3. If you get the files into a Text format (see 2 above), cobolToCsv may be useful - Csv files can generally be loaded in to Databases. cobolToCsv will not handle RM-Cobol files directly.


The RecordEditor mentioned by Simon is unlikely to handle RM-Cobol binary files but should handle unloaded Text files. It may prove useful (note I am the author of the RecordEditor)

Upvotes: 3

Related Questions