fthiella / icread

Quick and dirty ICobol .XD file reader
Apache License 2.0
1 stars 0 forks source link

icread

Read ICobol XD files, and export to CSV

background

My company has a lot of old icobol XD archives, still updated regularily, and we need to convert our XD files to CSV files. This is a quick and dirty tool that does the job.

how to use

icreader needs at least 3 parameters:

./icreader.pl -xd archive -xdt recordlayout -b bufferlength

example:

./ireader.pl -xd cobolArchive.xd -xdt recordLayout.xdt -b 24 > extractedData.csv

record layout

icreader uses a standard xdt odbc file to describe the record layout (but please note that on the columns section the value must be empty):

[Table]
NumColumns=5
MaxRecordSize=20

[Columns]
Year=
Month=
Description=
Value=

[Year]
Type=UNSIGNED COMP
Position=1
Length=1
Precision=2
Scale=0

[Month]
Type=UNSIGNED COMP
Position=2
Length=1
Precision=2
Scale=0

[Description]
Type=ALPHANUMERIC
Position=3
Length=15

[Value]
Type=DISPLAY
Position=17
Length=3
Precision=6

author

Federico Thiella http://stackoverflow.com/users/833073/fthiella

notes

This software is not complete, it works perfectly on my files but it might not work on any icobol file. Please let me know if you need any improvement.