<?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: Zip Codes Matching Issue: Leading Zeros in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547707#M12191</link>
    <description>If your original data had char ZIP code then you might have some non-numeric values.  For example you might have zip+4 values like '12345-1234'.&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Apr 2019 19:25:20 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-04-01T19:25:20Z</dc:date>
    <item>
      <title>Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547608#M12182</link>
      <description>&lt;P&gt;I tried to look around the community and other resources for an answer on this topic, but failed to locate an answer on this specific question in SAS Visual Analytics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue we're seeing is related to creating a zip code geo-variable on SAS Visual Analytics. Currently, we have several separate datasets that contain Zip Code columns, all of which seem to incorrectly match the shape-file when converting them into a geo-variable from a character variable. Here is some background information on the data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Data is imported into CAS via ODBC connection to Database.&lt;/LI&gt;&lt;LI&gt;The column is imported as a character, not as a measure. This means that all values retain the leading zero into SAS VA. (See attached photo - "values not matched" section of edit prompt)&lt;/LI&gt;&lt;LI&gt;Our shape file correctly maps a vast majority, if not all zip codes that do &lt;U&gt;not&lt;/U&gt; have leading 0's.&lt;/LI&gt;&lt;LI&gt;After investigating, we are certain it is the leading zeros. The proportion of non-matched values are always consistent with the proportion of zip codes having a leading zero.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It's also been observed that Puerto Rico seems to have issues displaying zip codes, as well as New Jersey. An example would be a hierarchy that drills down to Bergen County in NJ, but no zip codes are displayed due to leading zeros in each zip code for that county.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our best hypothesis:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;We imported the shape file incorrectly, which led to those values not being matched in any case due to an improper column format in the shape file.&lt;/LI&gt;&lt;LI&gt;The Zip Code values need to be in a proper format before conversion to Geo-variable.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Mon, 01 Apr 2019 12:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547608#M12182</guid>
      <dc:creator>BrandonD</dc:creator>
      <dc:date>2019-04-01T12:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547696#M12184</link>
      <description>&lt;P&gt;What is the structure of the two datasets?&lt;/P&gt;
&lt;P&gt;You need to either make the ZIPCODE variable numeric everywhere or character everywhere. If it is character then the values have to be consistent in how the digits are written into the character variable.&amp;nbsp; All with leading zeros. All without leading zeros and left aligned. All without leading zeros and right aligned.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 18:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547696#M12184</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-01T18:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547698#M12185</link>
      <description>&lt;P&gt;Hello Brandon,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, leading zeros are probably the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In VA, you can use string manipulation operators like Substring to get rid of the leading zeros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe that you'll want to do something like this, to get just the last 5 characters of the ZIP value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF (getLength('zip'n) &amp;gt; 5)&lt;/P&gt;
&lt;P&gt;RETURN Substring('zip'n, getLength('zip'n) - 4, getLength('zip'n))&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ELSE 'zip'n&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does that help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 18:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547698#M12185</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2019-04-01T18:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547700#M12186</link>
      <description>&lt;P&gt;On further review, I am wondering if your issue is that the leading zeros that are supposed to be there are missing. (PR zip codes start with 00, I believe).&lt;BR /&gt;&lt;BR /&gt;In that case you might want to use the Concatenate operator to prepend '0' as needed until getLength returns 5.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547700#M12186</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2019-04-01T19:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547702#M12187</link>
      <description>This was a good start for me but without having to do the adjustment via the calculated Item I used Parse to change the (database) varchar Zip to a NUMX and boom - length problem solved!</description>
      <pubDate>Mon, 01 Apr 2019 19:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547702#M12187</guid>
      <dc:creator>BrandonD</dc:creator>
      <dc:date>2019-04-01T19:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547704#M12189</link>
      <description>Excellent! Thanks for following up</description>
      <pubDate>Mon, 01 Apr 2019 19:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547704#M12189</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2019-04-01T19:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547705#M12190</link>
      <description>&lt;P&gt;This led me to the right place - The shape file had a numerical zip and the database zip had a varchar zip. The zip codes did not have to be in the 5 digit format as I had originally suspected to successfully match. I'm still seeing around 93% match, but I'm assuming the rest are probably related to the same issue and can be fixed with an updated zip shapefile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547705#M12190</guid>
      <dc:creator>BrandonD</dc:creator>
      <dc:date>2019-04-01T19:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Zip Codes Matching Issue: Leading Zeros</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547707#M12191</link>
      <description>If your original data had char ZIP code then you might have some non-numeric values.  For example you might have zip+4 values like '12345-1234'.&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Zip-Codes-Matching-Issue-Leading-Zeros/m-p/547707#M12191</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-01T19:25:20Z</dc:date>
    </item>
  </channel>
</rss>

