<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Different results running the same job on Windows and Linux in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279359#M54547</link>
    <description>I created a Talend job which imports data from a SQL database into a TMS database. 
&lt;BR /&gt;During this job, a varchar field is translated into an integer field. This is done in two steps: First I check if the varchar field is an Integer and if it's true, I convert it, else it becomes 0 (zero). 
&lt;BR /&gt;To do this, a piece of code is used: 
&lt;BR /&gt; 
&lt;PRE&gt;package routines;&lt;BR /&gt;public class MyRoutines {&lt;BR /&gt; public static Boolean isNumeric(String str) {&lt;BR /&gt;if(str.equals("")){&amp;nbsp; return false; }&lt;BR /&gt; for(int i=str.length();--i&amp;gt;=0;){ &lt;BR /&gt; int chr=str.charAt(i); &lt;BR /&gt;if((chr&amp;lt;48&amp;amp;&amp;amp;chr!=46&amp;amp;&amp;amp;chr!=45&amp;amp;&amp;amp;chr!=44)|| chr&amp;gt;57) &amp;nbsp; return false;&amp;nbsp; } return true;&amp;nbsp;&amp;nbsp; }}&lt;/PRE&gt; 
&lt;BR /&gt;This is in my tMap: 
&lt;BR /&gt; 
&lt;PRE&gt;MyRoutines.isNumeric((Relational.ISNULL(row1.WagenparkNummer)?"a":row1.WagenparkNummer))?Integer.parseInt(row1.WagenparkNummer):0&lt;/PRE&gt; 
&lt;BR /&gt;I created the job with Talend 5.1.2.r90681 and tested it on Windows 7.0. A random record says '001554' in SQL. After conversion the field is saved as 1554 in the TMS database. 
&lt;BR /&gt;I exported the job and extracted the zip file on a Linux system. (Nothing special, I have done this before for around 40 jobs). 
&lt;BR /&gt;And now the strange thing: After running the job on Linux, the same record is converted to 15 instead of 1554. 
&lt;BR /&gt;Why??? 
&lt;BR /&gt;Edit: 
&lt;BR /&gt;It only effects records with leading zero's. Records without leading zero's are converted in the correct way. 
&lt;BR /&gt;(Example given: '002534' is converted wrongly to 25. '2534' is converted to 2534.) 
&lt;BR /&gt;Screenshots: First subjob clears the output database. The second subjob retrieves information from a SQL server, convert some fields and store the result in the output database Kewill. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDT4.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137571i7538767D6D25A3F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDT4.jpg" alt="0683p000009MDT4.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDam.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144774iDD2B5E7F78FB3A84/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDam.png" alt="0683p000009MDam.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDar.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127712i87D0DC64882C5928/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDar.png" alt="0683p000009MDar.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Wed, 06 May 2015 14:09:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-06T14:09:59Z</dc:date>
    <item>
      <title>Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279359#M54547</link>
      <description>I created a Talend job which imports data from a SQL database into a TMS database. 
&lt;BR /&gt;During this job, a varchar field is translated into an integer field. This is done in two steps: First I check if the varchar field is an Integer and if it's true, I convert it, else it becomes 0 (zero). 
&lt;BR /&gt;To do this, a piece of code is used: 
&lt;BR /&gt; 
&lt;PRE&gt;package routines;&lt;BR /&gt;public class MyRoutines {&lt;BR /&gt; public static Boolean isNumeric(String str) {&lt;BR /&gt;if(str.equals("")){&amp;nbsp; return false; }&lt;BR /&gt; for(int i=str.length();--i&amp;gt;=0;){ &lt;BR /&gt; int chr=str.charAt(i); &lt;BR /&gt;if((chr&amp;lt;48&amp;amp;&amp;amp;chr!=46&amp;amp;&amp;amp;chr!=45&amp;amp;&amp;amp;chr!=44)|| chr&amp;gt;57) &amp;nbsp; return false;&amp;nbsp; } return true;&amp;nbsp;&amp;nbsp; }}&lt;/PRE&gt; 
&lt;BR /&gt;This is in my tMap: 
&lt;BR /&gt; 
&lt;PRE&gt;MyRoutines.isNumeric((Relational.ISNULL(row1.WagenparkNummer)?"a":row1.WagenparkNummer))?Integer.parseInt(row1.WagenparkNummer):0&lt;/PRE&gt; 
&lt;BR /&gt;I created the job with Talend 5.1.2.r90681 and tested it on Windows 7.0. A random record says '001554' in SQL. After conversion the field is saved as 1554 in the TMS database. 
&lt;BR /&gt;I exported the job and extracted the zip file on a Linux system. (Nothing special, I have done this before for around 40 jobs). 
&lt;BR /&gt;And now the strange thing: After running the job on Linux, the same record is converted to 15 instead of 1554. 
&lt;BR /&gt;Why??? 
&lt;BR /&gt;Edit: 
&lt;BR /&gt;It only effects records with leading zero's. Records without leading zero's are converted in the correct way. 
&lt;BR /&gt;(Example given: '002534' is converted wrongly to 25. '2534' is converted to 2534.) 
&lt;BR /&gt;Screenshots: First subjob clears the output database. The second subjob retrieves information from a SQL server, convert some fields and store the result in the output database Kewill. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDT4.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137571i7538767D6D25A3F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDT4.jpg" alt="0683p000009MDT4.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDam.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144774iDD2B5E7F78FB3A84/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDam.png" alt="0683p000009MDam.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDar.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127712i87D0DC64882C5928/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDar.png" alt="0683p000009MDar.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 06 May 2015 14:09:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279359#M54547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-06T14:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279360#M54548</link>
      <description>The field in the output table is a Numeric field. (Not signed with +/-, so negative numbers are impossible). Via ODBC the numbers are inserted in the correct way. Via JDBC the numbers are inserted in the wrong way. If I change the numeric field into a signed numeric field (in the output table), the numbers are inserted in the table in the correct way via both JDBC and ODBC.</description>
      <pubDate>Fri, 08 May 2015 11:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279360#M54548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T11:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279361#M54549</link>
      <description>Hi 
&lt;BR /&gt;Can you make a testing to use a tLogRow or tFileOutputDelimited instead of TMS database to see if the conversion is correct? In addition, to check a string value if it is a numeric type, you can use built-in function Mathematical.NUM("string"), for example: 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Mathematical.NUM&lt;FONT size="1"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;((Relational.ISNULL(row1.WagenparkNummer)?"a":row1.WagenparkNummer))==1?Integer.parseInt(row1.WagenparkNummer):0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 08 May 2015 11:49:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279361#M54549</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T11:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279362#M54550</link>
      <description>I have tried different things. Read this 
&lt;A href="http://stackoverflow.com/questions/30079265/different-results-running-the-same-job-on-windows-and-linux" target="_blank" rel="nofollow noopener noreferrer"&gt;thread&lt;/A&gt; (More active than this forum). 
&lt;BR /&gt;The conversion is correct. I tried a different input (.csv file), same different results. 
&lt;BR /&gt;I tried a different output (.csv), both (Windows/Linux) work correctly. 
&lt;BR /&gt;I changed the field type to Signed, instead of Numeric in the TMS table. It did not work 100%, instead of 1554 to 15, I now see 155 as result. 
&lt;BR /&gt;If I use Talend Studio for Windows, all works correct. If I use the Talend Job, run from the linux prompt, it goes wrong.</description>
      <pubDate>Fri, 08 May 2015 13:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279362#M54550</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T13:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279363#M54551</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;I tried a different output (.csv), both (Windows/Linux) work correctly.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;I changed the field type to Signed, instead of Numeric in the TMS table. It did not work 100%, instead of 1554 to 15, I now see 155 as result.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;So, the problem only occurs during the insertion into TMS database. I see you mentioned it is&amp;nbsp; 
&lt;FONT color="#222222"&gt;&lt;FONT face="'Helvetica Neue', Helvetica, Arial, sans-serif"&gt;GNU libgcj java 1.4 &amp;nbsp;on Linux system, you must have different java versions on Windows and Linux system, Talend product requires Oracle java 1.6 or higher, try to install Oracle java on Linux system. I don't know what is your TMS database, however, a workaround to resolve this issue could be: check the string record if it starts with 0, if true, remove the leading 0 and convert it to Integer type before inserting it to TMS database.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT color="#222222"&gt;&lt;FONT face="'Helvetica Neue', Helvetica, Arial, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT color="#222222"&gt;&lt;FONT face="'Helvetica Neue', Helvetica, Arial, sans-serif"&gt;Shong&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 08 May 2015 14:14:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279363#M54551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T14:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Different results running the same job on Windows and Linux</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279364#M54552</link>
      <description>I asked the sysadmin to install version Java RE 1.7 in a seperate directory, so I can try this.&lt;BR /&gt;The machine is running Redhat 5.5</description>
      <pubDate>Fri, 08 May 2015 14:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Different-results-running-the-same-job-on-Windows-and-Linux/m-p/2279364#M54552</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-08T14:53:58Z</dc:date>
    </item>
  </channel>
</rss>

