changing values in SPSS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

changing values in SPSS

stace swayne
Dear list,

  I have 650 identification numbers that are similiar to the following: A11967416

  I would like to shorten the identification numbers by dropping the last number from each ID for example instead of : A11967416   I want it to be A1196741.

  What type of code should I write to make this happen.

  All advice is appreciated.

  Stace


---------------------------------
Don't get soaked.  Take a quick peak at the forecast
 with theYahoo! Search weather shortcut.
Reply | Threaded
Open this post in threaded view
|

Re: changing values in SPSS

Melissa Ives
SUBSTR. SUBSTR(strexpr,pos,length). String. Returns the substring
beginning at position pos of strexpr and running for length length.

String newid (8).
Substr(oldid,1,8).

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
stace swayne
Sent: Wednesday, May 16, 2007 1:12 PM
To: [hidden email]
Subject: [SPSSX-L] changing values in SPSS

Dear list,

  I have 650 identification numbers that are similiar to the following:
A11967416

  I would like to shorten the identification numbers by dropping the
last number from each ID for example instead of : A11967416   I want it
to be A1196741.

  What type of code should I write to make this happen.

  All advice is appreciated.

  Stace


---------------------------------
Don't get soaked.  Take a quick peak at the forecast  with theYahoo!
Search weather shortcut.


PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.