<?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: Replace remainder of string from shifting starting point in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210424#M2919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;,(indexw(string,'ZIP')-1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jun 2015 21:39:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-06-19T21:39:00Z</dc:date>
    <item>
      <title>Replace remainder of string from shifting starting point</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210421#M2916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope someone can give me an assist here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have text data in one variable that varies in length. The field begins with a name and contains the word "ZIP" somewhere in the string. I need to find the occurrence of "ZIP" and remove all text after that occurrence to the end of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anyone who could point me in the right direction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Have&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;John M. Smith ZIP 99999 any town any city&lt;/P&gt;&lt;P&gt;Mary M. Smith any town any city ZIP 88888 some other text&lt;/P&gt;&lt;P&gt;Bill Murray title book ZIP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Want:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;John M. Smith&lt;/P&gt;&lt;P&gt;Mary M. Smith&lt;/P&gt;&lt;P&gt;Bill Murray&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 19:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210421#M2916</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2015-06-19T19:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Replace remainder of string from shifting starting point</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210422#M2917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string = substr(string,1,(indexw(string,'ZIP')));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where String is the name of your variable with the text. Note that the search is case sensitive, if you have values of Zip or zip they won't match.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 19:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210422#M2917</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-19T19:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replace remainder of string from shifting starting point</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210423#M2918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This mostly works. However, what I end up with is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John M. Smith Z&lt;/P&gt;&lt;P&gt;Mary M. Smith Z&lt;/P&gt;&lt;P&gt;Bill Murray Z&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 20:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210423#M2918</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2015-06-19T20:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replace remainder of string from shifting starting point</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210424#M2919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;,(indexw(string,'ZIP')-1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 21:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210424#M2919</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-19T21:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replace remainder of string from shifting starting point</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210425#M2920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very, very much. That works perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 22:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Replace-remainder-of-string-from-shifting-starting-point/m-p/210425#M2920</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2015-06-19T22:40:29Z</dc:date>
    </item>
  </channel>
</rss>

