At 11:55 AM 6/11/2008, J. Lerner wrote:
>Our office received multiple excel files with ID numbers that are
>suppose to be nine numbers long. Is there a way I can use SPSS
>syntax to insert "0"s infront of the ID's that are less than nine
>numbers long. Thank you.
This one comes up from time to time. The answer is, an SPSS number
can't *have* leading "0"s, or lack them either; SPSS numbers are
stored in a binary floating-point form. For your purpose, there are
two choices:
a. Set ID numbers' format so they *display* as 9 digits with leading
"0"s (the numbers themselves are unaltered). If the variable is named 'ID', use
FORMATS ID (N9).
b. Make the ID a character string rather than a number. You can do this:
STRING ID_Char (A9).
COMPUTE ID_Char=NUMBER(ID,N9).
Note that both use the 'N9' format.
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD