简体   繁体   中英

Executing XML to Copybook COBOL and vice versa transformation in JAVA application [on hold]

I am new to COBOL Copybook/ XML mapping. So please forgive me for any silly question I ask here.

Basically I'm required to perform XML to COBOL Copybook and vice versa transformation in a Java Application. I know it can be done in WebShpere Transformation eXtender (WTX) but my requirement is to do it in Java application where WTX runtime will not be available (I guess).

Is there any jars available which I can use in Java to perform these requirements? Any help in this regard would be much appreciated!

Have look at CobolToXml project . It can convert Xml to a Mainframe Binary File using a Cobol Copybook. The Xml tags must match the Cobol field names though.

See CobolToXml description wiki

To Convert Xml to a Cobol binary file in java:

JRecordConstantVars constants = Cobol2Xml.JR_CONSTANTS;

Cobol2Xml.newCobol2Xml("G:/Users/Bruce01/RecordEditor_HSQL/CopyBook/Cobol/DTAR020.cbl")

                                 // Cobol Options
                 .setFileOrganization(constants.IO_FIXED_LENGTH)
                 .setDialect(constants.FMT_MAINFRAME)               
                 .setSplitCopybook(constants.SPLIT_NONE)      
                 .setFont("cp037")

      .xml2Cobol("G:/Users/Bruce01/RecordEditor_HSQL/SampleFiles/DTAR020.bin.xml",
                 "G:/Users/Bruce01/RecordEditor_HSQL/SampleFiles/DTAR020byJava.bin");

Disclaimer I wrote CobolToXml

Check out the cb2xml project at https://sourceforge.net/projects/cb2xml/

  • Click Download , unzip the downloaded .zip file.
  • Navigate to the lib folder. You can add the cb2xml*.jar files to your project and use them in your Java development.

Check online Cobol to Xml converter: https://it.io/Cobol

(I represent the team behind it.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM