You can use camel-bindy which support to process fixedlength dataformat (
camel.apache.org/bindy.html) and generate java classes that next you can
use with camel-jaxb to transform them into XML. The opposite is also true
xml -> java objects -> fixedlength records
> Hello guys
> Is there any adapters in Camel which can parse the Cobol dataDump and
> Copybook and transform the file into XML format?
> I have the copybook ( supposed to be a structure definition for fixed
> records ) and another file containing those fixed length delimiter
> data set.
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel
> & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a > Twitter - reji_mathews
> View this message in context:
> http://camel.465427.n5.nabble.com/COBOL-data-parse-in-Camel-tp5772356.html > Sent from the Camel - Users mailing list archive at Nabble.com.
I initially locked in on the bindy component. But now i see that there are fields in the data and its repitition / cardinality will depend on value of another field.
Find a sample of copybook below. You can see that repetitions of REFR-COLR-DETAILS field can vary from 0-100 based on the value of column REFR-COLR-COUNT. Can bindy take this dynamic repetition characteristics.?
cb2xml will convert a Cobol-Copybook into Xml (with Field positions / lengths calculated). This Xml can then parsed with Jaxb or what ever language you choose.
A better option would be the Data2Xml program in JRecord. This program will convert a Cobol-Data-File to Xml. Currently it does not support Occurs Depending Supporting Occurs Depending would be a very minor change.