Hi Bruce,
I have a requirement to convert Cobol Copybook, to XML and vice versa, really appreciate if you could help me with some sample code or any example file.
We are not maintaining any Copybook schema. we only have meta XML that provides element name, position
and length.
Meta XML looks something similar to below tags
<item>
<item picture="X(35)" name="address" level="01" display-length="100" storage-length="100" position="1">
</item></item>
I have a requirement to convert Cobol Copybook to XML
and
We are not Copybook schema. we only have meta XML
Do you want to convert a Cobol Copybook to Xml or do you want to Convert a Cobol Data file to / from Xml ???
Meta XML looks something similar to below tags
<item>
<item picture="X(35)" name="address" level="01" display-length="100" storage-length="100" position="1">
</item></item>
This looks like the output from cb2xml. Cb2xml can produce files. You can process them in JRecord using:
Hi Bruce, Thanks for the reply.
I want to convert Cobol Data file to XML. Application reads Cobol data file (input) from Data Queue and convert it to XML (output). I tried XmlToMainframe().convert(sourceDocument, copyBookXml) and MainframeToXml().convert(sourceFileContents, copyBookXml), it's working as per my requirement.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Bruce,
I have a requirement to convert Cobol Copybook, to XML and vice versa, really appreciate if you could help me with some sample code or any example file.
We are not maintaining any Copybook schema. we only have meta XML that provides element name, position
and length.
Meta XML looks something similar to below tags
<item>
<item picture="X(35)" name="address" level="01" display-length="100" storage-length="100" position="1">
</item></item>
my requirement is something similar to below (RecordEditorXmlLoader...)
http://jrecord.sourceforge.net/JRecord04.html#Header_13
Thanks in advance.
I am free to change meta xml format... something similar to below (as suggested in the wiki)
<?xml version="1.0" ?>
<record recsep="default" style="0" recordtype="RecordLayout" recordname="DTAR020" quote="" list="Y" fontname="CP037" filestructure="Default" copybook="DTAR020" delimiter="<Tab>">
<fields>
<field position="1" length="8" type="Char" name="KEYCODE-NO"></field></fields></record>
I do not undestand what you want you have written
and
Do you want to convert a Cobol Copybook to Xml or do you want to Convert a Cobol Data file to / from Xml ???
Meta XML looks something similar to below tags
<item>
<item picture="X(35)" name="address" level="01" display-length="100" storage-length="100" position="1">
</item></item>
This looks like the output from cb2xml. Cb2xml can produce files. You can process them in JRecord using:
~~~java
Icb2xmlIOBuilder iob = JRecordInterface1.CB2XML
.newIOBuilder("G:\Users\BruceTst01\RecordEditor_HSQL\CopyBook\cb2xml\DTAR020.xml")
.setFont("cp037");
Hi Bruce, Thanks for the reply.
I want to convert Cobol Data file to XML. Application reads Cobol data file (input) from Data Queue and convert it to XML (output). I tried XmlToMainframe().convert(sourceDocument, copyBookXml) and MainframeToXml().convert(sourceFileContents, copyBookXml), it's working as per my requirement.
Thanks.