|
Cobol To Csv |
||||||
This project is for converting Simple Cobol Data Files to/from Csv Files. The project supports several Cobol dialects + number of other options. CobolToCsv depends on the following projects:
This project will take a Cobol-Copybook and Cobol-Data-File
Cobol-Copybook:
9 000900 03 DTAR020-KCODE-STORE-KEY. 10 001000 05 DTAR020-KEYCODE-NO PIC X(08). 11 001100 05 DTAR020-STORE-NO PIC S9(03) COMP-3. 12 001200 03 DTAR020-DATE PIC S9(07) COMP-3. 13 001300 03 DTAR020-DEPT-NO PIC S9(03) COMP-3. 14 001400 03 DTAR020-QTY-SOLD PIC S9(9) COMP-3. 15 001500 03 DTAR020-SALE-PRICE PIC S9(9)V99 COMP-3.
Cobol-Data-File:
And the script to convert the Cobol Data file to a Csv file (field delimiter=,):
java -jar ../lib/Cobol2Csv.jar ^ -C DTAR020.cbl -IFS Fixed_Length -IC CP037 ^ -Q DoubleQuote -Delimiter , ^ -I in/DTAR020.bin -O out/o_DTAR020_a.csv
And the Csv output from the above:
1 DTAR020_KEYCODE_NO,DTAR020_STORE_NO,DTAR020_DATE,DTAR020_DEPT_NO,DTAR020_QTY_SOLD,DTAR020_SALE_PRICE 2 69684558,20,40118,280,1,19.00 3 69684558,20,40118,280,-1,-19.00 4 69684558,20,40118,280,1,5.01 5 69694158,20,40118,280,1,19.00 6 69694158,20,40118,280,-1,-19.00 7 69694158,20,40118,280,1,5.01 8 63604808,20,40118,170,1,4.87 9 62684671,20,40118,685,1,69.99 10 62684671,20,40118,685,-1,-69.99 11 64634429,20,40118,957,1,3.99 12 66624458,20,40118,957,1,0.89 13 63674861,20,40118,957,10,2.70
CobolToCsv at SourceForge | Download Page | Forums |