<?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: Covert Source table column from hex to decimal in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/350099#M10419</link>
    <description>&lt;P&gt;It worked. I forgot to add the "input" at the begining of the code line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;input(strip(treatment_plans.patient_id), hex.) worked when I changed the type to numeric in the target column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a paint document to the solution so there is a visual record of the solution as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assist folks. It's appreciated.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13713i2A90B354151F9AE6/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Hex to Decimal Table Loader Solution.png" title="Hex to Decimal Table Loader Solution.png" /&gt;</description>
    <pubDate>Fri, 14 Apr 2017 17:16:34 GMT</pubDate>
    <dc:creator>gsmith</dc:creator>
    <dc:date>2017-04-14T17:16:34Z</dc:date>
    <item>
      <title>Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349920#M10402</link>
      <description>&lt;P&gt;I am using Data Integration studio (4.902). I have two source tables I am trying to join.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Table A has a column "patient_id" in&amp;nbsp;a numeric field (SQLServer)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Table B has the corresponding column "Patient_id" but stored as a Hexadecimal value. (MySQL)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I convert the Hex value&amp;nbsp;in table B to allow me to join it to the decimal value from table A?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The solution I came up with, and am struggling with, is to use the Table Loader transformation to convert the column&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in table B then join the resulting Work Table to table A.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have not been able to successfully convert the Hexadecimal value when loading it into the work table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried using&amp;nbsp;INPUT(B.patient_id, $hex11.) as an expression, with infomat $11. and format $11. I do not get a valid value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example B.patient_id =&amp;nbsp;4D32 is coming out as A.patient_id =&amp;nbsp;M2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There has to be a more direct way of doing this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 00:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349920#M10402</guid>
      <dc:creator>gsmith</dc:creator>
      <dc:date>2017-04-14T00:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349922#M10403</link>
      <description>&lt;P&gt;I miss typed the line "&lt;SPAN&gt;For example B.patient_id =&amp;nbsp;4D32 is coming out as A.patient_id =&amp;nbsp;M2"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It should read "For example B.patient_id =&amp;nbsp;4D32 is coming out as WorkTable.patient_id =&amp;nbsp;M2&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 00:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349922#M10403</guid>
      <dc:creator>gsmith</dc:creator>
      <dc:date>2017-04-14T00:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349930#M10404</link>
      <description>&lt;P&gt;First question: if you just convert your MySQL Table B to a SAS work dataset, what are the characteristics (numeric or character, length) of the resulting column in the SAS dataset?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 01:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349930#M10404</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-14T01:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349933#M10405</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;When I map table B directly into a SAS data set I get&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Type = Character Size = 5, Informat = $5. and format = $5. &amp;nbsp; and the data value is the same as the original Hex value in table A&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 01:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349933#M10405</guid>
      <dc:creator>gsmith</dc:creator>
      <dc:date>2017-04-14T01:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349942#M10406</link>
      <description>&lt;P&gt;Hex is a nuisance, as you're finding out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what I think you want, as an example. It converts character hex values to SAS numbers correctly. Note that the "strip" is very important to pass ONLY the hex characters to the input.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; patient_id $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; patient_id;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;num_patient_id = input(strip(patient_id), &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;hex.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;A4D32&lt;/P&gt;
&lt;P&gt;4D32&lt;/P&gt;
&lt;P&gt;D32&lt;/P&gt;
&lt;P&gt;32&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 02:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349942#M10406</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-14T02:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349951#M10408</link>
      <description>&lt;P&gt;That certainly works, how would I use that in a Data Integration Job?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 03:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349951#M10408</guid>
      <dc:creator>gsmith</dc:creator>
      <dc:date>2017-04-14T03:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349987#M10410</link>
      <description>In a mapping...?!</description>
      <pubDate>Fri, 14 Apr 2017 09:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/349987#M10410</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-04-14T09:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/350054#M10418</link>
      <description>&lt;P&gt;You mention using the Table Loader transformation to convert the column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I don't have DI Studio available, I believe that if you set up your target column as numeric, and transform your source column with a function of input(strip(patient_id), hex.), the resulting column will be able to be used to join with your other table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 14:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/350054#M10418</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-14T14:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Covert Source table column from hex to decimal</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/350099#M10419</link>
      <description>&lt;P&gt;It worked. I forgot to add the "input" at the begining of the code line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;input(strip(treatment_plans.patient_id), hex.) worked when I changed the type to numeric in the target column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a paint document to the solution so there is a visual record of the solution as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assist folks. It's appreciated.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13713i2A90B354151F9AE6/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Hex to Decimal Table Loader Solution.png" title="Hex to Decimal Table Loader Solution.png" /&gt;</description>
      <pubDate>Fri, 14 Apr 2017 17:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Covert-Source-table-column-from-hex-to-decimal/m-p/350099#M10419</guid>
      <dc:creator>gsmith</dc:creator>
      <dc:date>2017-04-14T17:16:34Z</dc:date>
    </item>
  </channel>
</rss>

