<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 14: Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/</link><description>Recent changes to 14: Muti threaded stack overflow error</description><atom:link href="https://sourceforge.net/p/cb2xml/bugs/14/feed.rss" rel="self"/><language>en</language><lastBuildDate>Sun, 18 Mar 2018 03:06:36 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cb2xml/bugs/14/feed.rss" rel="self" type="application/rss+xml"/><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#cd98</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;you need to keep it as bytes and write to a stream&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;private static byte[] xml2data(InputStream dataFileName, String copybookFileName)
throws FileNotFoundException, RecordException, IOException, JAXBException, XMLStreamException {

        ByteArrayOutputStream os = new ByteArrayOutputStream(0x10000);
        Cobol2GroupXml.newCb2Xml2Xml(copybookFileName)
                      .setFileOrganization(net.sf.JRecord.Common.Constants.IO_FIXED_LENGTH)
                      .setFonmt"cp037")
                      .xml2Cobol(dataFileName, os);
        return os.toByteArray();
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;write the bytes to a stream and send the file to mainframe as binary&lt;br/&gt;
(no ebcdic conversio as it is alreadyin ebcdic)&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    }
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Sun, 18 Mar 2018 03:06:36 -0000</pubDate><guid>https://sourceforge.netccee25bfa3a153915f9ff28f6b124110db6c8989</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#9cae</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
Thanks for you reply. &lt;br/&gt;
Currently, I am using the below method  for conversion.&lt;/p&gt;
&lt;p&gt;private static String xml2data(InputStream dataFileName, String copybookFileName) &lt;br/&gt;
            throws FileNotFoundException, RecordException, IOException, JAXBException, XMLStreamException {&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;            ByteArrayOutputStream os = new ByteArrayOutputStream(0x10000);
            Cobol2GroupXml.newCb2Xml2Xml(copybookFileName)
                          .setFileOrganization(net.sf.JRecord.Common.Constants.BINARY_IO)
                          .xml2Cobol(dataFileName, os);
            return new String(os.toByteArray());

        }
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Could you please let me know the constant value set in the setFileOrgnazation method?.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;br/&gt;
   S.Mouttou&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mouttou Coumara Vadivel</dc:creator><pubDate>Fri, 16 Mar 2018 10:29:18 -0000</pubDate><guid>https://sourceforge.net7720cb52a497f8a8a157107498b1132fc143fb59</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#8636</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Looking at the examples for latest cobol2xml : &lt;a href="https://sourceforge.net/projects/coboltoxml/files/"&gt;https://sourceforge.net/projects/coboltoxml/files/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;the example: xml2data.bat will convert a Xml file to binary cobol-ebcdic (Fixed length RECFM=FB) which could be used unchanged (i.e. binary transfer) on the mainframe&lt;/p&gt;
&lt;p&gt;Basically:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;java -jar ../lib/Xml2Cobol.jar ^
          -cobol DTAR020.cbl -font cp037 -fileOrganisation FixedWidth ^
          -input in/DTAR020.xml ^
          -output out/DTAR020_A.bin
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Fri, 16 Mar 2018 10:00:20 -0000</pubDate><guid>https://sourceforge.net77762fdc30de6440311ce5ad0de059ed742c6470</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#d5d1</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Did you check this query?&lt;/p&gt;
&lt;p&gt;Best Regards&lt;br/&gt;
S.Mouttou&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mouttou Coumara Vadivel</dc:creator><pubDate>Fri, 16 Mar 2018 07:40:25 -0000</pubDate><guid>https://sourceforge.netf3b3518cdf78f9f23067133670094f55709ec96d</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#603c</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;h2 id="xml-to-copy-book-conversion-using-jrecord"&gt;xml to copy book conversion using jrecord.&lt;/h2&gt;
&lt;p&gt;We have a requirement to send a value in computational format at backend.  I saw there is a feature called computational shown below&lt;/p&gt;
&lt;p&gt;&amp;lt;item display-length="8" level="10" name="CEX1000C-XML-BLK-SIZE" numeric="true" picture="S9(08)" position="2543" signed="true" storage-length="4" usage="computational"/&amp;gt;&lt;/p&gt;
&lt;p&gt;With the above configuration, When i am sending the value as 80  for the above field(CEX1000C-XML-BLK-SIZE), We could see that 'P' at the location 2543 after converted into copy book  using the below api of Jrecord &lt;/p&gt;
&lt;p&gt;String resultAck= xml2data(stream,"DefCpyDef.xml");&lt;/p&gt;
&lt;p&gt;When we check with the backend(mainframe), it looks like they got 215.&lt;/p&gt;
&lt;p&gt;When we further analyze, it is found we are suppose to send &amp;amp; character at the specified location(2543) to get the actual value of 80 at backend(mainframe).&lt;/p&gt;
&lt;p&gt;Based on the above, we derived the following algorithm,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Decimal to hexa decimal&lt;/li&gt;
&lt;li&gt;Hexa decimal to Ebcdic&lt;/li&gt;
&lt;li&gt;Ascii to hex&lt;/li&gt;
&lt;li&gt;hex to Decimal&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the step 3, we need to consider the ebcdic derived at step2 as ascii&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;To send 500 at backend, we are suppose to send 308 at our side for the comp field, &lt;/p&gt;
&lt;p&gt;To derive 308.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;500 convert to hex "01F4"&lt;/li&gt;
&lt;li&gt;F4 equivalent EBCDIC "4"; 01 equivalent EBCDIC "SOH"&lt;/li&gt;
&lt;li&gt;AsCII 4's equivalent hex "34"; AsCII SOH's equivalent hex "01"&lt;/li&gt;
&lt;li&gt;Hex 134 to decimal 308.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Currently, we are doing the above steps in the coding to achieve this requirement.  Though it is working fine, we don't want any custom coding to achieve this. So far, we have not done any customized coding for conversion of xml to copy book. &lt;/p&gt;
&lt;p&gt;To achieve the above, Do you have already any special feature in jrecrod, please let me know.&lt;br/&gt;
Otherwise, could you please add a new utility to achieve this in jrecrod itself.&lt;/p&gt;
&lt;p&gt;Note: We have been using jrecrod  for around 2 and half years, millions of messages going through. We have not faced any issues so far.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;br/&gt;
 S.Mouttou&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mouttou Coumara Vadivel</dc:creator><pubDate>Wed, 14 Mar 2018 07:15:00 -0000</pubDate><guid>https://sourceforge.net3fd9076e3000ccc8ec8c9780363dfa9b86ae27e5</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#6a55</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I have finnished the changes; see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://sourceforge.net/projects/coboltoxml/files/CobolToXml/Version_0.81.4/CobolToXml_0.81.4.7z/download"&gt;https://sourceforge.net/projects/coboltoxml/files/CobolToXml/Version_0.81.4/CobolToXml_0.81.4.7z/download&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To  use:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;java -jar ../lib/Cobol2Xml.jar -cobol DTAR020.cbl -font cp037    -fileOrganisation FixedWidth ^
                         -formatText usePlus ^
                         -input in/DTAR020.bin   ^
                         -output out/DTAR020_usePlusForNumeric.xml
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;the &lt;strong&gt;-formatText usePlus&lt;/strong&gt; is the important bit                           &lt;br/&gt;
&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Wed, 07 Dec 2016 03:58:34 -0000</pubDate><guid>https://sourceforge.net25ee981713d271a495c14e52b4d2c7cbc533d0ef</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#93c4</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;It will not take a lot of work but I will not have much time to work on it over the next week.&lt;/p&gt;
&lt;p&gt;So possibly 9/10 days&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Sat, 03 Dec 2016 03:50:16 -0000</pubDate><guid>https://sourceforge.netf9a133146b6293160023ed5deae3612dd180f961</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#d027</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Tks for your suggestion. I will go thorough the sample attached herewith and let you know. May I know when i can get the the updated code of implementing the below&lt;br/&gt;
•Numeric fields first digit should be +(symbol) - not possible at the moment: but I can probably make the changes&lt;/p&gt;
&lt;p&gt;Best Regards&lt;br/&gt;
S.Mouttou&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mouttou Coumara Vadivel</dc:creator><pubDate>Sat, 03 Dec 2016 02:52:46 -0000</pubDate><guid>https://sourceforge.net602e9f007eef1055f830aae548110c5f8a3211b6</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#2527</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I have had some thoughts on converting &lt;strong&gt;Cobol-Copybooks &amp;lt;--&amp;gt; JSON copybook&lt;/strong&gt;:&lt;br/&gt;
&lt;em&gt; In the examples that come with the cb2xml package there is code to convert the Xml into java objects using jaxb (see: &lt;a class="" href="https://sourceforge.net/p/cb2xml/SVN/HEAD/tree/source/cb2xml_examples/src/net/sf/cb2xml/example/Demo.java"&gt;example of loading and printing cb2xml using JAXB&lt;/a&gt; and &lt;a class="" href="https://sourceforge.net/p/cb2xml/SVN/HEAD/tree/source/cb2xml_examples/src/net/sf/cb2xml/jaxb/"&gt;Java Cobol Item definitions&lt;/a&gt;)&lt;br/&gt;
&lt;/em&gt; I also wrote a &lt;a class="" href="https://sourceforge.net/p/cb2xml/SVN/HEAD/tree/source/cb2xml_examples/src/net/sf/cb2xml/example/PrettyPrintCopybookJaxb.java"&gt;print program&lt;/a&gt; it converts a Cobol-Copybook into the JAXB format and then writes back out as Cobol.&lt;/p&gt;
&lt;p&gt;Format of the &lt;a class="" href="https://sourceforge.net/p/cb2xml/SVN/HEAD/tree/source/cb2xml_examples/src/net/sf/cb2xml/jaxb/"&gt;JAXB Items&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Copybook&lt;/strong&gt;&lt;br/&gt;
* List of &lt;strong&gt;Item&lt;/strong&gt;'s&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Item&lt;/strong&gt;&lt;br/&gt;
&lt;em&gt; List of &lt;strong&gt;condition&lt;/strong&gt;'s&lt;br/&gt;
&lt;/em&gt; List of &lt;strong&gt;Item&lt;/strong&gt;'s&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;It should be possible to read/write the &lt;strong&gt;Cobol item JAXB objects&lt;/strong&gt;  as JSON. So code for a &lt;strong&gt;Cobol Copybook &amp;lt;--&amp;gt; JSON Copybook&lt;/strong&gt; is there it just a matter of putting it all together. Let me know if that is what you need.&lt;/p&gt;
&lt;p&gt;I will attach the pretty print example&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Fri, 02 Dec 2016 23:59:18 -0000</pubDate><guid>https://sourceforge.net058a7562bfb706da908003e2d8e48a5b437a32a7</guid></item><item><title>#14 Muti threaded stack overflow error</title><link>https://sourceforge.net/p/cb2xml/bugs/14/?limit=25&amp;page=1#db75</link><description>&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Numeric fields first digit should be +(symbol)  - not possible at the moment: but I can probably make the changes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Do you want to convert the actual Cobol-Copybook to Json (and vice versa ???) - I do not have a project to do this.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I suggest looking at the Jaxb version of the Output from cb2xml. While you could look at Jaxb-Json conversion (e.g. &lt;a class="" href="https://eclipse.org/eclipselink/#moxy" rel="nofollow"&gt;moxy&lt;/a&gt; It would probably be better to simplify the JSON (for JSON --&amp;gt;&amp;gt; Cobol) step.&lt;/li&gt;
&lt;li&gt;Alternatively you could do your own &lt;strong&gt;CopyBookAnalyzer&lt;/strong&gt; class, bu I think working with the JAXB would be easier/safer.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you want  Cobol-Data --&amp;gt; Json I have written a CobolToJson converter. See &lt;a class="" href="https://sourceforge.net/projects/jrecord/files/jrecord/Version_0.81.4/"&gt;JRecord Downloads&lt;/a&gt; There is no Json to Cobol though&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruce Martin</dc:creator><pubDate>Thu, 01 Dec 2016 00:14:27 -0000</pubDate><guid>https://sourceforge.netac1bd0faf13daa98d9e9a58c478f03b81014e4ca</guid></item></channel></rss>