STNAMEL Function


STNAMEL Function

Converts state postal codes to mixed case state names

Category: State and ZIP Code

Syntax

STNAMEL ( 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

If the STNAMEL function returns a value to a variable that has not yet been assigned a length, by default the variable is assigned a length of 20.

The STNAMEL function converts a two-character state postal code (or world-wide GSA geographic code for U.S. territories ) to the corresponding state name in mixed case.

Note: For Version 6, the maximum length of the value that is returned is 200 characters. For Version 7 and beyond, the maximum length is 20 characters.

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' on page 541

  • 'FIPNAMEL Function' on page 542

  • 'FIPSTATE Function' on page 543

  • 'STFIPS Function' on page 831




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net