<?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: Looking for a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504669#M135102</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/210579"&gt;@ZosTa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please help:&lt;/P&gt;
&lt;P&gt;Using version 9.3 I have a dataset which is a list of NPO's around South Africa and is named NPOz. From&amp;nbsp;the 26 variables one is named Address and as the name suggests it contains the physical addresses for all the observed NPO's. From the address&amp;nbsp;variable, I want to extract the name of the city so as to&amp;nbsp;keep those that are from Johannesburg and Pretoria and&amp;nbsp;delete the rest. Please help me with the right code for this job.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please post example data.&lt;/P&gt;
&lt;P&gt;Use a data step with datalines, so we can easily recreate your dataset.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Oct 2018 11:38:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-10-16T11:38:52Z</dc:date>
    <item>
      <title>Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504667#M135100</link>
      <description>&lt;P&gt;Please help:&lt;/P&gt;&lt;P&gt;Using version 9.3 I have a dataset which is a list of NPO's around South Africa and is named NPOz. From&amp;nbsp;the 26 variables one is named Address and as the name suggests it contains the physical addresses for all the observed NPO's. From the address&amp;nbsp;variable, I want to extract the name of the city so as to&amp;nbsp;keep those that are from Johannesburg and Pretoria and&amp;nbsp;delete the rest. Please help me with the right code for this job.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 11:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504667#M135100</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-10-16T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504669#M135102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/210579"&gt;@ZosTa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please help:&lt;/P&gt;
&lt;P&gt;Using version 9.3 I have a dataset which is a list of NPO's around South Africa and is named NPOz. From&amp;nbsp;the 26 variables one is named Address and as the name suggests it contains the physical addresses for all the observed NPO's. From the address&amp;nbsp;variable, I want to extract the name of the city so as to&amp;nbsp;keep those that are from Johannesburg and Pretoria and&amp;nbsp;delete the rest. Please help me with the right code for this job.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please post example data.&lt;/P&gt;
&lt;P&gt;Use a data step with datalines, so we can easily recreate your dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 11:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504669#M135102</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-16T11:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504676#M135106</link>
      <description>&lt;P&gt;You could maybe do it with index()&lt;/P&gt;
&lt;PRE&gt;where index(upcase(address),"JOHANNESBURG") or index(upcase(address),"PRETORIA");&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2018 12:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504676#M135106</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-16T12:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504677#M135107</link>
      <description>data NPOz; *[1]*&lt;BR /&gt;input ID name source_url status category fax postal_address&lt;BR /&gt;physical_address phone $reg_no $reg_date email_address category1&lt;BR /&gt;category2 category3 ;&lt;BR /&gt;&lt;BR /&gt;datalines;&lt;BR /&gt;&lt;BR /&gt;143.655 Umusa_Wenkosi_Gospel_Ministries &lt;A href="http://www.npo.gov.za" target="_blank"&gt;www.npo.gov.za&lt;/A&gt; Registered&lt;BR /&gt;Development_and_Housing 113354483 P\B_X28_Johannesburg_2006&lt;BR /&gt;"33Church_Street""Alberton""Johannesburg""2006" ..............&lt;BR /&gt;&lt;BR /&gt;156.666 Mcmillan_House_of_Care &lt;A href="http://www.npo.gov.za" target="_blank"&gt;www.npo.gov.za&lt;/A&gt; Application_Declined&lt;BR /&gt;Health_Care 124568895 ...........................&lt;BR /&gt;&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;I tried my best to recreate the data in the data step but the actual&lt;BR /&gt;data set is imported from an excel spreadsheet.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Oct 2018 12:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504677#M135107</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-10-16T12:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504976#M135210</link>
      <description>&lt;P&gt;With Excel, you have the problem that you need to rely on guessing procedures when importing.&lt;/P&gt;
&lt;P&gt;Save the Excel data to a csv file, and post some sample lines (don't forget to anonymize if sensitive data is present) in a window opened with the {i} button, so we can see the file as-is. From that it will be possible to create a data step to read the csv.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 06:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504976#M135210</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-17T06:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504989#M135213</link>
      <description>&lt;P&gt;The index worked perfectly, Thank you RW9&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504989#M135213</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-10-17T08:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504990#M135214</link>
      <description>&lt;P&gt;Thank you everyone for your assistance, I used the index statement from RW9 and it works perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504990#M135214</guid>
      <dc:creator>ZosTa</dc:creator>
      <dc:date>2018-10-17T08:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504994#M135216</link>
      <description>&lt;P&gt;No worries.&amp;nbsp; Just bear in mind that it is an exact match, miss-spellings for instance wouldn't get picked up.&amp;nbsp; For that you would need a more complex algorithm, maybe using Regular Expressions, or some other pattern matching.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-a-string/m-p/504994#M135216</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-17T08:24:27Z</dc:date>
    </item>
  </channel>
</rss>

