<?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 last 7 letters from the data in a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146498#M262012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in various methods.&amp;nbsp; One way is:&lt;/P&gt;&lt;P&gt;tranwrd(string,"_fdf_er","");&lt;/P&gt;&lt;P&gt;the string needs to be the same (upper/lower and spacing).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or substr:&lt;/P&gt;&lt;P&gt;substr(string,1,index(string,"_")-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or various other methods (perl RE comes to mind, plus replace etc.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2014 12:59:43 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-05-06T12:59:43Z</dc:date>
    <item>
      <title>how to remove the last 7 letters from the data in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146497#M262011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset which has a variable in which data is for example tmmd_fdf_er and i want to remove_fdf_er from the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know whether substr can be used in this case&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 12:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146497#M262011</guid>
      <dc:creator>VRD</dc:creator>
      <dc:date>2014-05-06T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the last 7 letters from the data in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146498#M262012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in various methods.&amp;nbsp; One way is:&lt;/P&gt;&lt;P&gt;tranwrd(string,"_fdf_er","");&lt;/P&gt;&lt;P&gt;the string needs to be the same (upper/lower and spacing).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or substr:&lt;/P&gt;&lt;P&gt;substr(string,1,index(string,"_")-1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or various other methods (perl RE comes to mind, plus replace etc.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 12:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146498#M262012</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-06T12:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the last 7 letters from the data in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146499#M262013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data x;
a= 'tmmd_fdf_er';
b=substr(a,1,length(a)-7);
c=prxchange('s/.{7}$//',-1,a);
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-last-7-letters-from-the-data-in-a-variable/m-p/146499#M262013</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-05-06T13:20:32Z</dc:date>
    </item>
  </channel>
</rss>

