<?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 US Zip code validation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644103#M192343</link>
    <description>&lt;P&gt;I have 3 million records which have zip code as one of the entities. I need to validate whether they are valid zip codes are not.&lt;/P&gt;&lt;P&gt;I have the set of valid zip codes from sashelp.zipcode. Which is the best way to validate my data? Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2020 22:26:20 GMT</pubDate>
    <dc:creator>Test_yes</dc:creator>
    <dc:date>2020-04-29T22:26:20Z</dc:date>
    <item>
      <title>US Zip code validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644103#M192343</link>
      <description>&lt;P&gt;I have 3 million records which have zip code as one of the entities. I need to validate whether they are valid zip codes are not.&lt;/P&gt;&lt;P&gt;I have the set of valid zip codes from sashelp.zipcode. Which is the best way to validate my data? Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 22:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644103#M192343</guid>
      <dc:creator>Test_yes</dc:creator>
      <dc:date>2020-04-29T22:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: US Zip code validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644108#M192346</link>
      <description>&lt;P&gt;Depends on what you want. Do you want to mark a records a finding a match in the data set? Or that the Zipcode matches a state or city value that you have as well?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will help if you show what you want to see for "valid" and "invalid" zip codes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And are your zipcodes all 5 digit or do you have some Zip+4 codes?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 22:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644108#M192346</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-29T22:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: US Zip code validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644112#M192348</link>
      <description>&lt;P&gt;I want to keep the zip code only if it is valid in my dataset by validating against the look up file. If a particular zip is invalid I need to have null in my dataset for that row.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 23:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644112#M192348</guid>
      <dc:creator>Test_yes</dc:creator>
      <dc:date>2020-04-29T23:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: US Zip code validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644258#M192420</link>
      <description>Hello,&lt;BR /&gt;Hope this below snippet works for you.&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table final as&lt;BR /&gt;select&lt;BR /&gt;a.*,&lt;BR /&gt;b.zip as Zip2&lt;BR /&gt;&lt;BR /&gt;from&lt;BR /&gt;customer a&lt;BR /&gt;&lt;BR /&gt;left join&lt;BR /&gt;sashelp.zipcode b&lt;BR /&gt;on a.ZIP = b.ZIP&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;BR /&gt;Assuming the CUSTOMER table as a dataset which contains the invalid zip codes. If we left join the sashelp.zipcode to our CUSTOMER table and selecting the ZIP (as ZIP2) from&amp;amp;nbsp;sashelp.zipcode would leave the invalid ZIP with missing values (Since it SAS cannot find the matching value)&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;data&lt;BR /&gt;final(&lt;BR /&gt;drop=zip&lt;BR /&gt;rename=(zip2=zip)&lt;BR /&gt;);&lt;BR /&gt;set&lt;BR /&gt;final&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;In the above snippet we will drop the ZIP field with invalid codes and Rename the ZIP2 to ZIP(which obviously have the Invalid zip codes as '.')&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Note: the above code is written based on the assumption that the Zip code is 5 digit.</description>
      <pubDate>Thu, 30 Apr 2020 15:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644258#M192420</guid>
      <dc:creator>jagadeeshp</dc:creator>
      <dc:date>2020-04-30T15:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: US Zip code validation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644453#M192484</link>
      <description>&lt;P&gt;it worked. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 04:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/US-Zip-code-validation/m-p/644453#M192484</guid>
      <dc:creator>Test_yes</dc:creator>
      <dc:date>2020-05-01T04:25:15Z</dc:date>
    </item>
  </channel>
</rss>

