<?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: Extracting a postcode from an address in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48413#M5343</link>
    <description>What is the exact format of your INPUT-side and OUTPUT-side (desired) data string?  &lt;BR /&gt;
&lt;BR /&gt;
Consider that the SAS FIND function does permit searching from the end of a character variable, when using a negative third-argument, which is somewhat easier than having to go through the REVERSE gyrations multiple times.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 24 Jun 2009 15:21:01 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-06-24T15:21:01Z</dc:date>
    <item>
      <title>Extracting a postcode from an address</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48412#M5342</link>
      <description>As the heading suggests I am trying to create another column containing just the postcode. I am new to SAS and am really struggling. After reading various threads I think i need to use the SUBSTR function but keep ending up with a blank column.&lt;BR /&gt;
The only thing I have managed to do is REVERSE the line so the postcode is at the start.&lt;BR /&gt;
&lt;BR /&gt;
Any help greatfully  appreciated.</description>
      <pubDate>Wed, 24 Jun 2009 14:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48412#M5342</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-24T14:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a postcode from an address</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48413#M5343</link>
      <description>What is the exact format of your INPUT-side and OUTPUT-side (desired) data string?  &lt;BR /&gt;
&lt;BR /&gt;
Consider that the SAS FIND function does permit searching from the end of a character variable, when using a negative third-argument, which is somewhat easier than having to go through the REVERSE gyrations multiple times.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 24 Jun 2009 15:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48413#M5343</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-06-24T15:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting a postcode from an address</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48414#M5344</link>
      <description>google for postcode and perl regular expression&lt;BR /&gt;
That should help you locate a postcode within an address, if it is present.&lt;BR /&gt;
&lt;BR /&gt;
Alternatively, if you can assume postcode is the last one or two words, try&lt;BR /&gt;
  length   postcode $11 ;&lt;BR /&gt;
  postcode= scan( address, -1) ;&lt;BR /&gt;
  if length( postcode ) &amp;lt; 5 then &lt;BR /&gt;
  postcode= scan( address, -2) !!' '!! scan( address, -1) ;

Message was edited by: Peter.C</description>
      <pubDate>Wed, 24 Jun 2009 21:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extracting-a-postcode-from-an-address/m-p/48414#M5344</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-06-24T21:18:24Z</dc:date>
    </item>
  </channel>
</rss>

