<?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: how to extract certain bits from a string hex column to number ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14305#M13374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, MS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have trouble with these "Hex to .." command. They don't work on my case. Here's the screen copy. I don't know what could be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jane &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9804_substr.jpg" style="width: 805px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2176i5AB04C5960637D1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9804_substr.jpg" alt="9804_substr.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2016 00:38:00 GMT</pubDate>
    <dc:creator>jane_wang_seaga</dc:creator>
    <dc:date>2016-10-19T00:38:00Z</dc:date>
    <item>
      <title>how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14302#M13371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very simple question on how to extract certain bits from a string hex column(named Flags) to numbers. My column values will be like "0x1BA1". I would like to extract the bits 8 and 9 values and convert them to a value of 3 into my new column. Since I don't know the binary operation in jmp, I tried to extract B into 11 first by doing the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Char To Hex(Munger(:Flags, 4, 1)). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives me a character column of 42. I tried to put a "integer" in to the formula &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Char To Hex((Munger(:Flags, 4, 1)), "integer")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it wouldn't recognize it. I'm using jmp11.2.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After extracting B, I'll use module(module(value,8),4) to get the lower 2 bits. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there's an easy way to extract binary bits, that will be even better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jane &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 16:25:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14302#M13371</guid>
      <dc:creator>jane_wang_seaga</dc:creator>
      <dc:date>2015-09-15T16:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14303#M13372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a function Hex to Number() that converts hexadecimal numbers (as strings) to decimal numbers.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #942193;"&gt;&lt;SPAN style="color: #000000;"&gt;hex &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"0x1BA1"&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #008f00;"&gt;// Hex to decimal&lt;/P&gt;&lt;P style="font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;value &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Hex To Number&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;Substr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;hex&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;Show&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;value&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #008f00;"&gt;// decimal to binary&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;bin &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;While&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;value&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bin &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Char&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Modulo&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Num&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;value&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt; bin&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Floor&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;value &lt;SPAN style="color: #011993;"&gt;/&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;Show&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;bin&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;/P&gt;&lt;P style="font-family: Courier; color: #008f00;"&gt;// Reverse last step for confirmation (or just for fun)&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;value2 &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Sum&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;^&lt;/SPAN&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Loc&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Reverse&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Words&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;bin&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"1"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;Show&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;value2&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 17:54:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14303#M13372</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-09-15T17:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14304#M13373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before JMP 12 you'll need an even number of hex characters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hex To Number( "0B" )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 18:04:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14304#M13373</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2015-09-15T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14305#M13374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, MS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have trouble with these "Hex to .." command. They don't work on my case. Here's the screen copy. I don't know what could be wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jane &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9804_substr.jpg" style="width: 805px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2176i5AB04C5960637D1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="9804_substr.jpg" alt="9804_substr.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:38:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14305#M13374</guid>
      <dc:creator>jane_wang_seaga</dc:creator>
      <dc:date>2016-10-19T00:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14306#M13375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Craige pointed out (thanks, I was not aware), JMP 11 requires an even number of hex characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this formula for single character substrings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hex To Number&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"0"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;||&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Substr&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;Flags&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 18:55:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14306#M13375</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-09-15T18:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14307#M13376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Craig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you. The magic "0" in front of "B" is the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:28:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14307#M13376</guid>
      <dc:creator>jane_wang_seaga</dc:creator>
      <dc:date>2015-09-15T20:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract certain bits from a string hex column to number ?</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14308#M13377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, MS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the concat "0" and it works.&lt;/P&gt;&lt;P&gt;Jane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 20:29:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-extract-certain-bits-from-a-string-hex-column-to-number/m-p/14308#M13377</guid>
      <dc:creator>jane_wang_seaga</dc:creator>
      <dc:date>2015-09-15T20:29:55Z</dc:date>
    </item>
  </channel>
</rss>

