LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
=========================================================================
Date:         Fri, 7 Jul 2006 13:43:00 -0500
Reply-To:     "Oliver, Richard" <roliver@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Oliver, Richard" <roliver@SPSS.COM>
Subject:      Re: Truncating zip code
Comments: To: "Frommelt, Allen" <Frommelt@chime.org>
Content-Type: text/plain; charset="US-ASCII"

If zip code is a number, use the trunc function, as in: compute newzip=trunc(oldzip/10000).

If it's a string, create a new string variable that's only 5-characters and then set it equal to the old string, which will get truncated, as in:

string newzip (a5) compute newzip=oldzip.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Frommelt, Allen Sent: Friday, July 07, 2006 1:28 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Truncating zip code

I am interested in mapping patient origin from zip code. Our zip codes are currently 9 character strings, but our mapping software can only read five character zip codes. Does anyone on the list know of a method in SPSS that will allow me to create a 5 character zip code variable by lopping off the last four characters (e.g., 06451333 would become 06451).

Thanks


Back to: Top of message | Previous page | Main SPSSX-L page