<?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: Suppressing ZIPSTATE Note: / Error: in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10649#M892</link>
    <description>The reason that ZIPSTATE returns more codes than are in the table is in the documentation that I referenced:&lt;BR /&gt;
&lt;BR /&gt;
"To determine which state corresponds to a particular ZIP code, this function uses a zone table that consists of the start and end ZIP code values for each state. It then finds the corresponding state for that range of ZIP codes. The zone table consists of start and end ZIP code values for each state to allow for exceptions, and does not validate ZIP code values."&lt;BR /&gt;
&lt;BR /&gt;
It also documents why you find differences in location over time.&lt;BR /&gt;
&lt;BR /&gt;
"With very few exceptions, a zone does not span multiple states. The exceptions are included in the zone table. It is possible for new zones or new exceptions to be added by the U.S. Postal Service at any time. "</description>
    <pubDate>Tue, 27 Apr 2010 17:36:24 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2010-04-27T17:36:24Z</dc:date>
    <item>
      <title>Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10645#M888</link>
      <description>I've searched online quite a bit and haven't found a solution to this.  Is there any way to suppress the following Note/Error when an invalid zipcode is passed to the zipstate function?&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Invalid argument to function ZIPSTATE at line 109 column 85.&lt;BR /&gt;
ERROR: Limit set by ERRORS= option reached.  Further errors of this type will &lt;BR /&gt;
not be printed.&lt;BR /&gt;
&lt;BR /&gt;
I realize it is a valid error, but I'd rather just have the result of the zipstate function return a null with no note/error in the log if the zipcode being passed to it is invalid.&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Tue, 27 Apr 2010 12:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10645#M888</guid>
      <dc:creator>jklein271</dc:creator>
      <dc:date>2010-04-27T12:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10646#M889</link>
      <description>You could always query the data table directly, SASHELP.ZIPCODE, to get the state. &lt;BR /&gt;
&lt;BR /&gt;
Note that the data is generally a year or two out of date.  I just installed SAS 9.2 TS2M2 and the data are still from April 2008.  See&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000212667.htm#a003069100" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000212667.htm#a003069100&lt;/A&gt;</description>
      <pubDate>Tue, 27 Apr 2010 13:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10646#M889</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-04-27T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10647#M890</link>
      <description>Thanks, Doc.  That's sort of the approach I'm going with.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone confirm that the zipstate function feeds off of SASHELP.ZIPCODE directly?  I try to update the ZIPCODE table in HELP from SAS's website (http://support.sas.com/rnd/datavisualization/mapsonline/html/misc.html) as soon as they become available.  However, I'm seeing some major discrepancies when comparing the results of ZIPSTATE versus SASHELP.ZIPCODE.  The online doc states the following:&lt;BR /&gt;
&lt;BR /&gt;
"The SASHELP.ZIPCODE data set contains postal code information that is used with the ZIPSTATE and other ZIP code functions. This data set is updated with each new release of SAS software."&lt;BR /&gt;
&lt;BR /&gt;
Is this true for manual updates after a software release as well?  I'm seeing 7 state differences between the two sources.  Also, if you loop from 0 to 99999 and feed it to zipstate, it assigns a state to 95,760 zipcodes whereas my current sashelp.zipcodes has 42,085.</description>
      <pubDate>Tue, 27 Apr 2010 15:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10647#M890</guid>
      <dc:creator>jklein271</dc:creator>
      <dc:date>2010-04-27T15:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10648#M891</link>
      <description>Thinking about it some more ZIPSTATE returning more zipcodes with states than SASHELP.ZIPCODE is making sense.  I would imagine the latter is only active zips at that size.  ZIPSTATE would return a state for any zipcode that's ever been active.  Let's say this theory is accurate and explains the difference in zipcode count.  &lt;BR /&gt;
&lt;BR /&gt;
It still doesn't explain differences in state assignment to a zipcode if zipstate is feeding off of sashelp.&lt;BR /&gt;
&lt;BR /&gt;
/*zipcode	                sashelp_state	zipstate_state*/&lt;BR /&gt;
/*20588		MD	                DC*/&lt;BR /&gt;
/*20598		VA                            DC*/&lt;BR /&gt;
/*83414		WY		ID*/&lt;BR /&gt;
/*96595		CA		*/&lt;BR /&gt;
/*96598		CA		*/&lt;BR /&gt;
/*96599		CA		*/&lt;BR /&gt;
/*96939		PW		GU*/</description>
      <pubDate>Tue, 27 Apr 2010 16:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10648#M891</guid>
      <dc:creator>jklein271</dc:creator>
      <dc:date>2010-04-27T16:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10649#M892</link>
      <description>The reason that ZIPSTATE returns more codes than are in the table is in the documentation that I referenced:&lt;BR /&gt;
&lt;BR /&gt;
"To determine which state corresponds to a particular ZIP code, this function uses a zone table that consists of the start and end ZIP code values for each state. It then finds the corresponding state for that range of ZIP codes. The zone table consists of start and end ZIP code values for each state to allow for exceptions, and does not validate ZIP code values."&lt;BR /&gt;
&lt;BR /&gt;
It also documents why you find differences in location over time.&lt;BR /&gt;
&lt;BR /&gt;
"With very few exceptions, a zone does not span multiple states. The exceptions are included in the zone table. It is possible for new zones or new exceptions to be added by the U.S. Postal Service at any time. "</description>
      <pubDate>Tue, 27 Apr 2010 17:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10649#M892</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-04-27T17:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Suppressing ZIPSTATE Note: / Error:</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10650#M893</link>
      <description>Thanks again.  For anyone that's interested, this is what I ended up doing.  There are no errors in the log for invalid arguments and it actually runs a little faster than the function straight up.  Below is the code I used as a base and then my code.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.sascommunity.org/wiki/Fixed_Zipstate_function" target="_blank"&gt;http://www.sascommunity.org/wiki/Fixed_Zipstate_function&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
* Zipcode to State using ZIPSTATE() = zipstate;&lt;BR /&gt;
      data fmts(drop=i);&lt;BR /&gt;
       length start $ 5 end $ 5 fmtname $ 8 label $ 2 type $ 1;&lt;BR /&gt;
       retain fmtname "zipstate" hlo " " type "C";&lt;BR /&gt;
       do i=0 to 99999;&lt;BR /&gt;
            start=PUT(i,z5.);&lt;BR /&gt;
            end=start;&lt;BR /&gt;
            label=zipstate(start);&lt;BR /&gt;
            if label &amp;gt; '' then output; &lt;BR /&gt;
            end;&lt;BR /&gt;
       start=' '; hlo = 'O'; label=' '; output; &lt;BR /&gt;
       run; &lt;BR /&gt;
       proc format library = VAULT cntlin=fmts; run;&lt;BR /&gt;
       proc datasets library=work nolist; delete fmts; quit;</description>
      <pubDate>Tue, 27 Apr 2010 18:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Suppressing-ZIPSTATE-Note-Error/m-p/10650#M893</guid>
      <dc:creator>jklein271</dc:creator>
      <dc:date>2010-04-27T18:50:00Z</dc:date>
    </item>
  </channel>
</rss>

