<?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: Mainframe Hex input to manipulate each nibble in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791985#M1367</link>
    <description>&lt;P&gt;When you use an INPUT then you are using an INFORMAT to read text into numeric values. You said that you already have a hex value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the difference with this which uses an existing Hex value and creates the desired character value:&lt;/P&gt;
&lt;PRE&gt;data test;                  
   name='6C6C'x;                    
   name2=put(name,$hex4.);       
run;        &lt;/PRE&gt;
&lt;P&gt;PUT uses the FORMAT to display the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/413968"&gt;@MarkATremel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your response.&amp;nbsp; However, before I try this, I notice that the SAS documentation says that for this informat, this is the behavior, but I would need it to write 6C6C to the SAS log.&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;data test;                  
   name='6C6C';                    
   name2=input(name,$hex4.);       
run;                               &lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class=""&gt;SAS writes the following output to the log:&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;PRE&gt;11&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 20:57:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-01-24T20:57:47Z</dc:date>
    <item>
      <title>Mainframe Hex input to manipulate each nibble</title>
      <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791967#M1364</link>
      <description>&lt;P&gt;I need to input two hexadecimal bytes and manipulate the 4 nibbles that are contained within.&amp;nbsp; For example, the two bytes in the file contain '13BC'x.&amp;nbsp; The first nibble is '1', the second nibble is '3', the third nibble is 'B' and the fourth nibble is 'C'.&amp;nbsp; Due to some *creative* programming, I need to isolate the first nibble and interpret it and then isolate the last three nibbles and interpret them.&amp;nbsp; If the 4 nibbles can be converted to a string, I can proceed from there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know which informat and/or functions I would use to produce a 4 char string of hex characters that I can then manipulate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; I am a long time mainframe base SAS user, but first time question asker!&amp;nbsp; Thanks in advance for any hints, suggestions or outright answers!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 19:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791967#M1364</guid>
      <dc:creator>MarkATremel</dc:creator>
      <dc:date>2022-01-24T19:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mainframe Hex input to manipulate each nibble</title>
      <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791977#M1365</link>
      <description>Format $HEX4.</description>
      <pubDate>Mon, 24 Jan 2022 20:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791977#M1365</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-01-24T20:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Mainframe Hex input to manipulate each nibble</title>
      <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791982#M1366</link>
      <description>&lt;P&gt;Thank you for your response.&amp;nbsp; However, before I try this, I notice that the SAS documentation says that for this informat, this is the behavior, but I would need it to write 6C6C to the SAS log.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE class=""&gt;&lt;CODE&gt;data test;                  
   name='6C6C';                    
   name2=input(name,$hex4.);       
run;                               &lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class=""&gt;SAS writes the following output to the log:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;11&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Jan 2022 20:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791982#M1366</guid>
      <dc:creator>MarkATremel</dc:creator>
      <dc:date>2022-01-24T20:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mainframe Hex input to manipulate each nibble</title>
      <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791985#M1367</link>
      <description>&lt;P&gt;When you use an INPUT then you are using an INFORMAT to read text into numeric values. You said that you already have a hex value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the difference with this which uses an existing Hex value and creates the desired character value:&lt;/P&gt;
&lt;PRE&gt;data test;                  
   name='6C6C'x;                    
   name2=put(name,$hex4.);       
run;        &lt;/PRE&gt;
&lt;P&gt;PUT uses the FORMAT to display the value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/413968"&gt;@MarkATremel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your response.&amp;nbsp; However, before I try this, I notice that the SAS documentation says that for this informat, this is the behavior, but I would need it to write 6C6C to the SAS log.&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;data test;                  
   name='6C6C';                    
   name2=input(name,$hex4.);       
run;                               &lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class=""&gt;SAS writes the following output to the log:&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;PRE&gt;11&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 20:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791985#M1367</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-24T20:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Mainframe Hex input to manipulate each nibble</title>
      <link>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791986#M1368</link>
      <description>&lt;P&gt;More detail:&amp;nbsp; I hope this helps to explain my situation better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INPUT...&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;@0553 SUSPCD01 $HEX4.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@0555 SUSPCD02 $HEX4.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@0557 SUSPCD03 $HEX4.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Invalid data for SUSPCD01 in line 2 553-556. &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Invalid data for SUSPCD02 in line 2 555-558. &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Invalid data for SUSPCD03 in line 2 557-560. &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;501 ..................................................... . . ...........&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ZONE 0000000000000000000000000000000000000000000000000000&lt;FONT color="#FF0000"&gt;1B1B1B&lt;/FONT&gt;00000000000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NUMR 0000000000000000000000000000000000000000000000000000&lt;FONT color="#FF0000"&gt;3CBCBC&lt;/FONT&gt;00000000000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SUSPCD01= SUSPCD02= SUSPCD03=&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 20:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Mainframe-Hex-input-to-manipulate-each-nibble/m-p/791986#M1368</guid>
      <dc:creator>MarkATremel</dc:creator>
      <dc:date>2022-01-24T20:58:18Z</dc:date>
    </item>
  </channel>
</rss>

