Chapter Contents

Previous

Next
ZIPNAME

ZIPNAME



Converts ZIP codes to uppercase state names

Category: State and ZIP Code


Syntax
Arguments
Details
Comparisons
Examples
See Also

Syntax

ZIPNAME(zip-code)

Arguments

zip-code
specifies any SAS character expression that contains a five-digit ZIP code.
Requirement: The character expressions you use must have a length of five, or the function generates an error.


Details

ZIPNAME returns the name of the state or U.S. territory that corresponds to its five-character ZIP code argument. ZIPNAME returns character values up to 20 characters long, all in uppercase.


Comparisons

The ZIPNAME, ZIPNAMEL, and ZIPSTATE functions take the same argument but return different values. ZIPNAME returns the uppercase name of the state or U.S. territory that corresponds to its five-character ZIP code argument. ZIPNAMEL returns the mixed case name of the state or U.S. territory that corresponds to its five-character ZIP code argument. ZIPSTATE returns the uppercase two-character state postal code (or world-wide GSA geographic code for U.S. territories) that corresponds to its five-character ZIP code argument.


Examples

The examples below show the differences when using ZIPNAME, ZIPNAMEL, and ZIPSTATE.

SAS Statements Results
state=zipname('27511');
put state;
 
NORTH CAROLINA
state=zipnamel('27511');
put state;
 
North Carolina
st=zipstate('27511');
put st;
 
NC


See Also

Functions:
ZIPFIPS
ZIPNAMEL
ZIPSTATE


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.