<?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 last one digit and first two digits from a number in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673399#M23495</link>
    <description>&lt;PRE&gt;data have;
input ID $;
want=prxchange('s/^\d\d|\d\s*$//',-1,id);
cards;
2000032
2000072
2000092
;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jul 2020 12:43:34 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-07-30T12:43:34Z</dc:date>
    <item>
      <title>remove last one digit and first two digits from a number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673116#M23486</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;2000032&lt;/P&gt;&lt;P&gt;2000072&lt;/P&gt;&lt;P&gt;2000092&lt;/P&gt;&lt;P&gt;I want the dataset:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;0003&lt;/P&gt;&lt;P&gt;0007&lt;/P&gt;&lt;P&gt;0009&lt;/P&gt;&lt;P&gt;I want to remove first 2digits and last one digit.&lt;/P&gt;&lt;P&gt;Can anyone help in this. thank you&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673116#M23486</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2020-07-29T13:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: remove last one digit and first two digits from a number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673118#M23487</link>
      <description>&lt;P&gt;It's hard to generalize from such a small example. Are there always two digits at the start and always one digit at the end? Are the strings always 7 characters? It seems as if all you want is characters 3 4 5 and 6, so this code will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new_id=substr(id,3,4);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 13:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673118#M23487</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-29T13:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: remove last one digit and first two digits from a number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673399#M23495</link>
      <description>&lt;PRE&gt;data have;
input ID $;
want=prxchange('s/^\d\d|\d\s*$//',-1,id);
cards;
2000032
2000072
2000092
;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jul 2020 12:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673399#M23495</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-30T12:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: remove last one digit and first two digits from a number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673410#M23496</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID $;
datalines;
2000032
2000072
2000092
;

data want;
set have;
id = substr(id,3,4);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code might nicely illustrate that your question suffers from a Maxim 42 issue.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 12:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-last-one-digit-and-first-two-digits-from-a-number/m-p/673410#M23496</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-30T12:56:07Z</dc:date>
    </item>
  </channel>
</rss>

