Zipcode Cleaning

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

jdeluca
Posts: 1
Joined: Wed Sep 21, 2011 3:58 pm

Zipcode Cleaning

Postby jdeluca » Wed Sep 21, 2011 4:07 pm

When I import zipcode values into SPSS it imports as a string variable and retains zipcodes which have a '0' as the first digit in the series- for example - 02319. However when I change the variable from string to numeric- SPSS eats up the first '0' and effectively changes the value of the zipcode for example- 2139. How do I prevent this from happening? I have syntax coding all US zipcodes into states but it includes the initial '0' for those zipcodes and can not be run on the adjusted values.

Thanks!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Zipcode Cleaning

Postby GerineL » Mon Sep 26, 2011 9:27 am

If you convert it to numeric it will always disappear.
This makes sense, since 08 is the same number as 8.

If you want to keep the 0, keep it string.

Who is online

Users browsing this forum: No registered users and 3 guests

cron