Sample 24803: Convert U.S. ZIP codes to state names, city names, or state postal codes
Compare the ZIPNAME, ZIPNAMEL, ZIPSTATE and ZIPCITY functions. These functions work with a U.S. 5-digit ZIP code.
Note ZIPCITY is new in SAS 9.1.
Click here to access the most recently updated SASHELP.ZIPCODE data set.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
/* These functions work with a U.S. 5-digit ZIP code. */
/* ZIPCITY is new in SAS 9.1. */
data test;
input code $5.;
city_st=zipcity(code);
upper_st=zipname(code);
prop_st=zipnamel(code);
st_abbr=zipstate(code);
datalines;
27511
37375
49001
;
proc print;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Obs code city_st upper_st prop_st st_abbr
1 27511 Cary, NC NORTH CAROLINA North Carolina NC
2 37375 Sewanee, TN TENNESSEE Tennessee TN
3 49001 Kalamazoo, MI MICHIGAN Michigan MI
Compare the ZIPNAME, ZIPNAMEL, ZIPSTATE and ZIPCITY functions.
| Type: | Sample |
| Topic: | SAS Reference ==> DATA Step SAS Reference ==> Functions ==> State and ZIP Code
|
| Date Modified: | 2006-10-12 03:03:16 |
| Date Created: | 2004-09-30 14:09:15 |
Operating System and Release Information
| SAS System | Base SAS | All | n/a | n/a |