<?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 Remove First 3 Words in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228173#M16618</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the input:&lt;/P&gt;&lt;P&gt;BOM_ZEB_MIC_1002214_API_1002214_K304330&lt;/P&gt;&lt;P&gt;BOM_EVR_MIC_11000000002328_API_11000000002328_243&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And out put required is:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1002214_API_1002214_K304330&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;11000000002328_API_11000000002328_243&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to remove the first 3 Words as you can see in output.What function to be used for this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Sanchit Arora&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2015 08:33:25 GMT</pubDate>
    <dc:creator>SanchitArora</dc:creator>
    <dc:date>2015-10-02T08:33:25Z</dc:date>
    <item>
      <title>Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228173#M16618</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the input:&lt;/P&gt;&lt;P&gt;BOM_ZEB_MIC_1002214_API_1002214_K304330&lt;/P&gt;&lt;P&gt;BOM_EVR_MIC_11000000002328_API_11000000002328_243&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And out put required is:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1002214_API_1002214_K304330&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;11000000002328_API_11000000002328_243&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to remove the first 3 Words as you can see in output.What function to be used for this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Sanchit Arora&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 08:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228173#M16618</guid>
      <dc:creator>SanchitArora</dc:creator>
      <dc:date>2015-10-02T08:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228179#M16619</link>
      <description>&lt;P&gt;Use the substr() function with the findc() function and the "d" paramer:&lt;/P&gt;
&lt;PRE&gt;data have;
  length text new_text $2000;
  text="BOM_ZEB_MIC_1002214_API_1002214_K304330"; 
  new_text=substr(text,findc(text,"1","d"));
  output;
  text="BOM_EVR_MIC_11000000002328_API_11000000002328_243"; 
  new_text=substr(text,findc(text,"1","d"));
  output;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2015 08:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228179#M16619</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-10-02T08:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228180#M16620</link>
      <description>&lt;P&gt;Thank you so much for the solution. It its working&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 08:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228180#M16620</guid>
      <dc:creator>SanchitArora</dc:creator>
      <dc:date>2015-10-02T08:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228181#M16621</link>
      <description>&lt;P&gt;Do bear in mind that it looks for the first occurence of a number in the string, and then substrings from there. &amp;nbsp;If your data like the given examples you will be fine, just remember the above.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 09:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228181#M16621</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-10-02T09:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228182#M16622</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found &amp;nbsp;new problem . Sorry i have to mention earlier .&lt;/P&gt;&lt;P&gt;I have a Input like:&lt;/P&gt;&lt;P&gt;BOM_WAR_MIC_R740193 Output coming as :740193&lt;/P&gt;&lt;P&gt;BOM_EVR_MIC_CD5T:&amp;nbsp;&lt;SPAN&gt;Output coming as :&lt;/SPAN&gt;5T&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need output as:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;R740193&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CD5T: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 09:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228182#M16622</guid>
      <dc:creator>SanchitArora</dc:creator>
      <dc:date>2015-10-02T09:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228188#M16623</link>
      <description>&lt;P&gt;Yes, thats why I mentioned it. &amp;nbsp;Basically the idea is to find a logical pattern in the data (as I don't have the data I can't tell you), then find that data and substring from that point. &amp;nbsp;Now say that your data is always separated by MIC, then you would do:&lt;/P&gt;
&lt;P&gt;substr(text,find(text,"MIC")+4);&lt;/P&gt;
&lt;P&gt;This will find the text MIC, then from the start position of MIC + four (so we don't get MIC_ in the output) substring out to the end of the string. &amp;nbsp;Maybe if its always from the third underscore you could do:&lt;/P&gt;
&lt;P&gt;new_string=strip(tranwrd(string,cats(scan(string,1,"_"),"_",scan(string,2,"_"),"_",scan(string,3,"_"),"_"),""));&lt;/P&gt;
&lt;P&gt;What the above does is scan out the first three parts as delimited by the underscore and screate a string with the underscores, that text then being removed from the string by use of tranwrd.&lt;/P&gt;
&lt;P&gt;Its really up to how your data looks and what the logical delimiter is.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 09:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228188#M16623</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-10-02T09:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Remove First 3 Words</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228220#M16624</link>
      <description>&lt;P&gt;An alternative would be using Perl Regular Expression:&lt;/P&gt;&lt;P&gt;The following code will replace the first 3 words by nothing, meaning: removing them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;new_text=prxchange('s/^([^_]+_){3}//o', -1, text);&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2015 14:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Remove-First-3-Words/m-p/228220#M16624</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-10-02T14:38:34Z</dc:date>
    </item>
  </channel>
</rss>

