<?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 remove the first numbers from a character var, including  numbers and &amp;quot;.&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288971#M59649</link>
    <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 02 Aug 2016 16:58:40 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-08-02T16:58:40Z</dc:date>
    <item>
      <title>how to remove the first numbers from a character var, including  numbers and "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288968#M59647</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;2.1 Child Conditions
2.2 Teenage Conditions
 2.3 Adult Conditions
2.4 Senior Conditions
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I need to modify this variable, by deleting 2.1, 2.2 etc. and keep Child conditions etc. The lengths of the words left are not same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The desired var2 should be&lt;/P&gt;
&lt;P&gt;Child conditions&lt;/P&gt;
&lt;P&gt;teenage conditions&lt;/P&gt;
&lt;P&gt;adult conditions&lt;/P&gt;
&lt;P&gt;senior conditions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Compress can only remove ., any advice how to remove the first numbers?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288968#M59647</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-08-02T16:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the first numbers from a character var, including  numbers and "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288970#M59648</link>
      <description>&lt;P&gt;Assuming you do not have spaces before the numbers in question&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variable = substr(variable,index(variable,' ')+1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;might work.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288970#M59648</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-02T16:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the first numbers from a character var, including  numbers and "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288971#M59649</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/288971#M59649</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-08-02T16:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the first numbers from a character var, including  numbers and "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/297188#M62379</link>
      <description>&lt;P&gt;Actually, &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#n0fcshr0ir3h73n1b845c4aq58hz.htm" target="_self"&gt;COMPRESS with the appropriate modifiers&lt;/A&gt; could handle this particular problem very nicely &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; The third argument accepts modifiers to change the behavior of COMPRESS. In this case, I'd use 'k' for KEEP (instead of the default REMOVE behavior) and add an 'a' to specify ALPHABETIC characters along with 's' to specify SPACE characters. The STRIP function gets rid of any leading spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="4"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&amp;nbsp;&amp;nbsp; length&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt; Original Fixed $ &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;30&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&amp;nbsp;&amp;nbsp; infile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt; datalines &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;dsd&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&amp;nbsp;&amp;nbsp; input&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt; Original;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Fixed=strip(compress(original,,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="4"&gt;&lt;FONT color="#800080" face="Courier New" size="4"&gt;&lt;FONT color="#800080" face="Courier New" size="4"&gt;'kas'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&amp;nbsp;&amp;nbsp; put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt; original=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;$quote.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt; Fixed=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;&lt;FONT color="#008080" face="Courier New" size="4"&gt;$quote.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;&lt;FONT color="#0000ff" face="Courier New" size="4"&gt;datalines&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="4"&gt;&lt;FONT face="Courier New" size="4"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;2.1 Child Conditions&lt;/P&gt;
&lt;P&gt;2.2 Teenage Conditions&lt;/P&gt;
&lt;P&gt;2.3 Adult Conditions&lt;/P&gt;
&lt;P&gt;2.4 Senior Conditions&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;&lt;!--BEGINTABLE--&gt;
&lt;TABLE class="table" border="1" rules="groups" frame="hsides" cellspacing="0" cellpadding="7" summary="Procedure Print: Data Set WORK.TEST"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Original&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;Fixed&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;2.1 Child Conditions&lt;/TD&gt;
&lt;TD class="l data"&gt;Child Conditions&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;2.2 Teenage Conditions&lt;/TD&gt;
&lt;TD class="l data"&gt;Teenage Conditions&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;2.3 Adult Conditions&lt;/TD&gt;
&lt;TD class="l data"&gt;Adult Conditions&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;2.4 Senior Conditions&lt;/TD&gt;
&lt;TD class="l data"&gt;Senior Conditions&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;!--ENDTABLE--&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Sep 2016 14:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-first-numbers-from-a-character-var-including/m-p/297188#M62379</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2016-09-08T14:43:39Z</dc:date>
    </item>
  </channel>
</rss>

