<?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: Remove numbering from a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880481#M347891</link>
    <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n0fcshr0ir3h73n1b845c4aq58hz.htm" target="_self"&gt;COMPRESS function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;variable = compress(variable,,'d');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 17:01:15 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-06-13T17:01:15Z</dc:date>
    <item>
      <title>Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880479#M347890</link>
      <description>&lt;P&gt;Hello everyone, I have a variable which contains items such as:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Symptoms, signs, and abnormal clinical and laboratory findings&lt;/P&gt;
&lt;P&gt;2. Injury and poisoning&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only want to keep the character portion:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Symptoms, signs, and abnormal clinical and laboratory findings&lt;/P&gt;
&lt;P&gt;Injury and poisoning&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could someone please help me?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 16:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880479#M347890</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-06-13T16:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880481#M347891</link>
      <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/n0fcshr0ir3h73n1b845c4aq58hz.htm" target="_self"&gt;COMPRESS function&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;variable = compress(variable,,'d');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880481#M347891</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-13T17:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880492#M347894</link>
      <description>&lt;P&gt;This method does not remove the . as well ?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880492#M347894</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2023-06-13T17:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880494#M347895</link>
      <description>&lt;P&gt;I would find the first period and remove from there onwards using substring.&lt;/P&gt;
&lt;P&gt;Compress may inadvertenly remove any other numeric/periods.&lt;/P&gt;
&lt;P&gt;However, these were likely used to order the data so assuming you don't need that you'll be fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x=findc(variable, '.');
want = substr(variable, x);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880494#M347895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-13T17:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880499#M347896</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This method does not remove the . as well ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please give us a complete description of the problem. Show us representative examples.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880499#M347896</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-13T17:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove numbering from a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880506#M347897</link>
      <description>&lt;P&gt;If you know that every value has that numeric prefix then just remove the first "word".&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want=left(substrn(string,1+length(scan(string,1,' '))));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise you will have to work harder first to figure out if the string does have the prefix.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input string $CHAR80. ;
cards4;
1.  Symptoms, signs, and abnormal clinical and laboratory findings
2. Injury and poisoning
;;;;

data want ;
  set have;
  new_string = prxchange('s/^ *\d+\. +(.*)$/\1/',1,string);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1686680043413.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84955i45F46D1DE0677438/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1686680043413.png" alt="Tom_0-1686680043413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 18:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-numbering-from-a-variable/m-p/880506#M347897</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-13T18:26:52Z</dc:date>
    </item>
  </channel>
</rss>

