<?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: cut an alphanumeric value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658380#M197325</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329668"&gt;@Caro17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this, to begin with the character in first position&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;diag = substr(diagnose,1,3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jun 2020 17:52:21 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2020-06-14T17:52:21Z</dc:date>
    <item>
      <title>cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658375#M197322</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my boss wants to know how often he diagnosed a certain disease. That means I have alphanumeric values, e. g. "A12.9". Now I want to cut this value, so that I get in a different column "A12". I have tried several things but it didn't function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example I used a data-set with "diag = substr(diagnose,0,3);" however the column keeps empty. I tried also "substr(m.strdiagnose,0,3) as dia" within the select-statement in proc sql and the column keeps empty as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What else can I try to solve this problem?&amp;nbsp;Thanx a lot for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS Enterprise Guide Version 7.15 HF2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Caro&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 17:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658375#M197322</guid>
      <dc:creator>Caro17</dc:creator>
      <dc:date>2020-06-14T17:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658376#M197323</link>
      <description>&lt;P&gt;Its hard to generalize from a single example. Is there always a period in the character string? Do you always want the text to the left of the period?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newstring = scan(oldstring,1,'.');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Jun 2020 17:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658376#M197323</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-14T17:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658377#M197324</link>
      <description>&lt;P&gt;Yes, the structure is always the same. And yes, I need the three characters on the left.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 17:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658377#M197324</guid>
      <dc:creator>Caro17</dc:creator>
      <dc:date>2020-06-14T17:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658380#M197325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329668"&gt;@Caro17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this, to begin with the character in first position&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;diag = substr(diagnose,1,3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 17:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658380#M197325</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-06-14T17:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658390#M197327</link>
      <description>&lt;P&gt;Given that you always want the first three characters, here is a simple way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   length newstring $ 3;
   set have;
   newstring = oldstring;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There's only room to store 3 characters in NEWSTRING, so you will end up with the first three.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 19:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658390#M197327</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-06-14T19:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658431#M197346</link>
      <description>&lt;P&gt;Position numbers start with 1, not zero.&amp;nbsp; Just like normal counting.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 01:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658431#M197346</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-15T01:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: cut an alphanumeric value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658513#M197357</link>
      <description>&lt;P&gt;I get the result I want with the version from PaigeMiller.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;newstring = scan(oldstring,1,'.');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 05:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cut-an-alphanumeric-value/m-p/658513#M197357</guid>
      <dc:creator>Caro17</dc:creator>
      <dc:date>2020-06-15T05:28:57Z</dc:date>
    </item>
  </channel>
</rss>

