<?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 Re: [resolved] Packed Decimals in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371679#M134591</link>
    <description>Hi,&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Could you please elaborate your case with an example with input and expected output values?&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;</description>
    <pubDate>Thu, 11 Aug 2016 10:32:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-08-11T10:32:45Z</dc:date>
    <item>
      <title>[resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371676#M134588</link>
      <description>Hello,&lt;BR /&gt;I have a positional file with some fields being in Packed Decimal format. I have successfully ceated possitional file schema. How do I convert values that are in Packed decimal format to regular decimals? Also i saw something about tFileInputEBCDIC component but i can't find it in my studio. Could anyone give me any suggestions? &lt;BR /&gt;Thank you</description>
      <pubDate>Sat, 16 Nov 2024 10:27:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371676#M134588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371677#M134589</link>
      <description>Hi,&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;The EBCDIC components have been deprecated several version ago to be replaced by Talend Data Mapper.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;The old components have been published on Talend Exchange &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;and are provided as is, without support from Talend for version 6.0+.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;A href="https://exchange.talend.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://exchange.talend.com/&lt;/A&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Arial, Helvetica, sans-serif"&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 11 Aug 2016 09:13:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371677#M134589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T09:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371678#M134590</link>
      <description>Hello, Thank you for the reply,&lt;BR /&gt;I now have the file schema, and only a few fields are in S9(7)V99 or similar formats, is there any simple way to tell talend to treat those fields as such? It gives me null if I just set it as BigDecimal.</description>
      <pubDate>Thu, 11 Aug 2016 10:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371678#M134590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T10:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371679#M134591</link>
      <description>Hi,&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Could you please elaborate your case with an example with input and expected output values?&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;FONT face="Calibri, sans-serif"&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 11 Aug 2016 10:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371679#M134591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T10:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371680#M134592</link>
      <description>I have a positional file with rows like that - packed decimals are not showing :
&lt;BR /&gt;C910124141094141090011604263N1AB7AP0GL655147 fþ16042616SENTRA 1.8 S CV160426DF BDSALSENTR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;C542134136294136290011604263N1AB7AP4GL653515 Ÿ^16042616SENTRA 1.8 S CV160426DF BDSALSENTR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;C910124141174141170011604263N1AB7AP5GL654981 fþ16042616SENTRA 1.8 S CV160426DF BDSALSENTR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;C521124136334136330011604263N1AB7AP7GL656523 16042616SENTRA 1.8SV&amp;nbsp; C160426DF ¬øBDSALSENTR &amp;nbsp;&amp;nbsp;&amp;nbsp; with the output format similar to: 
&lt;BR /&gt;C--52112---413633---413633---001---160426---3N1AB7AP7GL656523---(some S9(7)V99 format number) ---160426---16---SENTRA 1.8SV&amp;nbsp; C--160426--DF--(some S9(7)V99 format number)--BDSALSENTR
&lt;BR /&gt;I made metadata for the positional file, but how to parse those S9(7)V99 numbers?
&lt;BR /&gt;Is there any function I could use?</description>
      <pubDate>Thu, 11 Aug 2016 11:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371680#M134592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T11:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371681#M134593</link>
      <description>This is resolved now the solution was: 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create a positional file in the repository where the columns of Packed decimals are of type byte[] 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create routine ParsePackedDecimal with a method parse to convert byte[] packed decimal to long integer. 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp; : 
&lt;BR /&gt; 
&lt;PRE&gt;public static long parse(byte[] pdIn) throws Exception {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Convert packed decimal to long&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final int PlusSign = 0x0C; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Plus sign&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final int MinusSign = 0x0D; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Minus&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final int NoSign = 0x0F; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Unsigned&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final int DropHO = 0xFF; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // AND mask to drop HO sign bits&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final int GetLO &amp;nbsp;= 0x0F; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Get only LO digit&lt;BR /&gt; &amp;nbsp; long val = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Value to return&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(int i=0; i &amp;lt; pdIn.length; i++) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int aByte = pdIn&lt;I&gt; &amp;amp; DropHO; // Get next 2 digits &amp;amp; drop sign bits&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(i == pdIn.length - 1) { &amp;nbsp; &amp;nbsp;// last digit?&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int digit = aByte &amp;gt;&amp;gt; 4; &amp;nbsp; &amp;nbsp;// First get digit&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = val*10 + digit;&lt;BR /&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("digit=" + digit + ", val=" + val);&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int sign = aByte &amp;amp; GetLO; &amp;nbsp;// now get sign&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (sign == MinusSign)&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;val = -val;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Do we care if there is an invalid sign?&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(sign != PlusSign &amp;amp;&amp;amp; sign != NoSign)&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new Exception("OC7");&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}else {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int digit = aByte &amp;gt;&amp;gt; 4; &amp;nbsp; &amp;nbsp;// HO first &amp;nbsp;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = val*10 + digit;&lt;BR /&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("digit=" + digit + ", val=" + val);&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; digit = aByte &amp;amp; GetLO; &amp;nbsp; &amp;nbsp; &amp;nbsp;// now LO&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; val = val*10 + digit;&lt;BR /&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("digit=" + digit + ", val=" + val);&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt; &amp;nbsp; return val;&lt;BR /&gt; &amp;nbsp; } // end parse()&lt;/I&gt;&lt;/PRE&gt; 
&lt;BR /&gt;3. Connect tFileInputPositional (In Basic settings check the box "Use byte length as the cardinality" and in Advanced settings uncheck the box "Trim all columns") to TXMLMap and tXMLMap to tfileOutputDElimited or any other format you want to use.&amp;nbsp; In the mapping,&amp;nbsp; expressions tool needs to be used to transform packed decimal to its string representation: 
&lt;BR /&gt;Expression to convert packed decimal from byte[] to long: 
&lt;BR /&gt;ParsePackedDecimal.parse(YourRow.YourColumnName) 
&lt;BR /&gt;My example: 
&lt;BR /&gt;ParsePackedDecimal.parse(row9.DLY_DRAFT_AMT) 
&lt;BR /&gt;Then we need to convert this long integer value to our desired decimal precision in the next expression: 
&lt;BR /&gt;Numeric.convertString2BigDecimal("9(7)V99",String.valueOf(Var.Var1)).toString() 
&lt;BR /&gt;There is function&amp;nbsp; Numeric.convertImpliedDecimalFormat, but it should not be used as it is losing precision. 
&lt;BR /&gt;4. Var.Var2 is your parsed and formatted packed decimal as a string and ready to be written to xML or other file.</description>
      <pubDate>Fri, 12 Aug 2016 14:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371681#M134593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-12T14:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Packed Decimals</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371682#M134594</link>
      <description>Hi,&lt;BR /&gt;Great it is fixed. Thanks for your solution.&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Mon, 15 Aug 2016 10:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Packed-Decimals/m-p/2371682#M134594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-15T10:13:45Z</dc:date>
    </item>
  </channel>
</rss>

