<?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: Deleting words before a trigger word in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766039#M242713</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you want the variable 'c' in the dataset 'want' :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
a="Sacramento is the capital of California"; output;
a="The capital of California is Sacramento"; output;
run;

data want;
 set have;
 b=indexw(a,'capital');
 c=substr(a,b);
 d=substr(a,b+length('capital'));
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Sat, 04 Sep 2021 17:19:25 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-09-04T17:19:25Z</dc:date>
    <item>
      <title>Deleting words before a trigger word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766038#M242712</link>
      <description>&lt;P&gt;I have a sentence "Sacramento is the capital of California" and am told to delete the words before the word "capital" and keep the rest. Now, the code has to be written so that if the word "capital" moves around then everything before it will be deleted. For example, "The capital of California is Sacramento" then only "The" in this sentence will be removed, whereas in the previous sentence "Sacramento is the" would have been removed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help please! Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 17:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766038#M242712</guid>
      <dc:creator>Yughaber</dc:creator>
      <dc:date>2021-09-04T17:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting words before a trigger word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766039#M242713</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you want the variable 'c' in the dataset 'want' :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
a="Sacramento is the capital of California"; output;
a="The capital of California is Sacramento"; output;
run;

data want;
 set have;
 b=indexw(a,'capital');
 c=substr(a,b);
 d=substr(a,b+length('capital'));
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 17:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766039#M242713</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-09-04T17:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting words before a trigger word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766042#M242715</link>
      <description>Thank you very much!!</description>
      <pubDate>Sat, 04 Sep 2021 17:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766042#M242715</guid>
      <dc:creator>Yughaber</dc:creator>
      <dc:date>2021-09-04T17:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting words before a trigger word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766043#M242716</link>
      <description>another question regarding this, if I were to not use the index function would I be able to code it any differently?</description>
      <pubDate>Sat, 04 Sep 2021 17:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766043#M242716</guid>
      <dc:creator>Yughaber</dc:creator>
      <dc:date>2021-09-04T17:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting words before a trigger word</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766045#M242718</link>
      <description>&lt;P&gt;You can also use the FINDW function.&lt;/P&gt;
&lt;P&gt;I would not use the SCAN function (you cannot scan for a whole word).&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 17:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-words-before-a-trigger-word/m-p/766045#M242718</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-09-04T17:50:54Z</dc:date>
    </item>
  </channel>
</rss>

