*(Q) I need to retain the leading zeros of zip codes when I import my Excel data
file into SPSS. Can you tell me how to do this? When SPSS opens my Excel
data file, the leading zeros are lost. I need them in order to merge 2
files.
*(A) Since you need the leading zeros to match, it means your zip codes are
strings. The following code converts numbers into strings with leading
zeros.
* Posted to SPSSX-L lsit by Raynald Levesque on 2002/03/12.
DATA LIST LIST /zipnum.
BEGIN DATA
2
125
2364
62514
END DATA.
LIST.
STRING zip(A5).
COMPUTE zip=STRING(zipnum,N5).
LIST.
* The out put is as follows:
ZIPNUM ZIP
2.00 00002
125.00 00125
2364.00 02364
62514.00 62514