COBOL data parse in Camel

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

COBOL data parse in Camel

contactreji
This post was updated on .
Hello guys

Are 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 length records ) and another file containing those fixed length delimiter separated data set.

Cheers
Reji
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
Reply | Threaded
Open this post in threaded view
|

Re: COBOL data parse in Camel

Charles Moulliard-2
Hi Reji,

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

Regards,


On Wed, Oct 7, 2015 at 7:27 AM, contactreji <[hidden email]> wrote:

> 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
> length
> records ) and another file containing those fixed length delimiter
> separated
> data set.
>
> Cheers
> Reji
>
>
>
> -----
> 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.
>



--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
Reply | Threaded
Open this post in threaded view
|

Re: COBOL data parse in Camel

contactreji
Thanks Charles

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.?

01 BNDL-COLR-OUT-REC.
   05  ITEM-REF-COLR-REC.
       10  BUNDLE-HEADER.
           15  BUNDLE-CODE            PIC  X(04).
           15  BUNDLE-DELIMITER       PIC  X(02).
           15  BUNDLE-BUS-EVNT-TS     PIC  X(26).
           15  DELI-HEAD-01           PIC  X(02).
           15  ACTION-IDENTIFIER      PIC  X(01).
           15  DELI-HEAD-02           PIC  X(02).
           15  SEQ-ID                 PIC  9(09).
           15  DELI-HEAD-03           PIC  X(02).
       10  BUNDLE-KEY-INFO.
           15  PROD-ID                PIC  9(15).
           15  DELI-KEY-01            PIC  X(02).
           15  TCIN-ID                PIC  9(12).
           15  DELI-KEY-02            PIC  X(02).
           15  DPCI                   PIC  X(11).
           15  DELI-KEY-03            PIC  X(02).
       10  BUNDLE-DET-REFR.
           15  REFR-COLR-COUNT        PIC  9(02).
           15  DELI-DET-01            PIC  X(02).
           15  REFR-COLR-DETAILS      OCCURS 0 TO 99
                      TIMES DEPENDING ON REFR-COLR-COUNT.
               20  REFR-COLR-I        PIC  9(09).
               20  DELI-DET-02        PIC  X(02).
               20  REFR-COLR-PRIM-F   PIC  X(01).
               20  DELI-DET-03        PIC  X(02).
               20  SEC-COLR-ORD-I     PIC  9(04).
               20  DELI-DET-04        PIC  X(02).
               20  COLR-N             PIC  X(50).
               20  DELI-DET-05        PIC  X(02).
           15  ROW-DELIMETER          PIC  X(02).
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
Reply | Threaded
Open this post in threaded view
|

Re: COBOL data parse in Camel

David J. M. Karlsen
Would http://sourceforge.net/projects/cb2xml/ be of use? Although a little
old (but so are copybooks :))

2015-10-07 7:37 GMT+02:00 contactreji <[hidden email]>:

> Thanks Charles
>
> 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.?
>
> 01 BNDL-COLR-OUT-REC.
>    05  ITEM-REF-COLR-REC.
>        10  BUNDLE-HEADER.
>            15  BUNDLE-CODE            PIC  X(04).
>            15  BUNDLE-DELIMITER       PIC  X(02).
>            15  BUNDLE-BUS-EVNT-TS     PIC  X(26).
>            15  DELI-HEAD-01           PIC  X(02).
>            15  ACTION-IDENTIFIER      PIC  X(01).
>            15  DELI-HEAD-02           PIC  X(02).
>            15  SEQ-ID                 PIC  9(09).
>            15  DELI-HEAD-03           PIC  X(02).
>        10  BUNDLE-KEY-INFO.
>            15  PROD-ID                PIC  9(15).
>            15  DELI-KEY-01            PIC  X(02).
>            15  TCIN-ID                PIC  9(12).
>            15  DELI-KEY-02            PIC  X(02).
>            15  DPCI                   PIC  X(11).
>            15  DELI-KEY-03            PIC  X(02).
>        10  BUNDLE-DET-REFR.
>            15  REFR-COLR-COUNT        PIC  9(02).
>            15  DELI-DET-01            PIC  X(02).
>            15  REFR-COLR-DETAILS      OCCURS 0 TO 99
>                       TIMES DEPENDING ON REFR-COLR-COUNT.
>                20  REFR-COLR-I        PIC  9(09).
>                20  DELI-DET-02        PIC  X(02).
>                20  REFR-COLR-PRIM-F   PIC  X(01).
>                20  DELI-DET-03        PIC  X(02).
>                20  SEC-COLR-ORD-I     PIC  9(04).
>                20  DELI-DET-04        PIC  X(02).
>                20  COLR-N             PIC  X(50).
>                20  DELI-DET-05        PIC  X(02).
>            15  ROW-DELIMETER          PIC  X(02).
>
>
>
> -----
> 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-tp5772356p5772358.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Reply | Threaded
Open this post in threaded view
|

Re: COBOL data parse in Camel

Bruce Martin
In reply to this post by contactreji
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.