Previous Page | Next Page

Functions and CALL Routines

STFIPS Function



Converts state postal codes to FIPS state codes.
Category: State and ZIP Code

Syntax
Arguments
Details
Comparisons
Examples
See Also

Syntax

STFIPS(postal-code)


Arguments

postal-code

specifies a character expression that contains the two-character standard state postal code. Characters can be mixed case. The function ignores trailing blanks, but generates an error if the expression contains leading blanks.


Details

The STFIPS function converts a two-character state postal code (or world-wide GSA geographic code for U.S. territories) to the corresponding numeric U.S. Federal Information Processing Standards (FIPS) code.


Comparisons

The STFIPS, STNAME, and STNAMEL functions take the same argument but return different values. STFIPS returns a numeric U.S. Federal Information Processing Standards (FIPS) code. STNAME returns an uppercase state name. STNAMEL returns a mixed case state name.


Examples

The examples show the differences when using STFIPS, STNAME, and STNAMEL.

SAS Statements Results
fips=stfips ('NC');
put fips;
 
37
state=stname('NC');
put state;
 
NORTH CAROLINA
state=stnamel('NC');
put state;
 
North Carolina


See Also

Functions:

FIPNAME Function

FIPNAMEL Function

FIPSTATE Function

STNAME Function,

STNAMEL Function

Previous Page | Next Page | Top of Page