Date: Wed, 19 Jun 2002 16:15:08 -0400
Reply-To: Mark Casazza <Mark.Casazza@domino1.cuny.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Mark Casazza <Mark.Casazza@domino1.cuny.edu>
Subject: Re: question
Content-Type: text/plain; charset="US-ASCII"
Here is an example of how to do this. You should be able to modify it to
clean up whatever else you need to.
DATA LIST LIST /make (a10) model (a5).
* standardize Ford per example.
COMPUTE make = upcase(make).
* search for string "pu" and populate new variable.
STRING mod2 (a6).
IF INDEX(upcase(model),"PU") GT 0 mod2 = 'pickup'.
Mark V. Casazza
Director of Academic Information
The City University of New York
555 W. 57th St. Suite 1240
New York, NY 10019
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Sent: Wednesday, June 19, 2002 3:39 PM
I have a giant database of vehicles and the make and model fields are
dirty. The data entry folks have botched things up, typing in Ford in
every which way imaginable. And then there's the F1PU, F2PU and just PU
for pickup models. And so on. You can only imagine. There are
hundreds of permutations of models and I'm trying to simplify them for
So I'm trying to use the recode "tool" to do this and I was hoping to
create some sort of an If statement that would look for say, PU, in the
model field and if it sees that, it would recode it in a new field as
The thing is, I'm at a loss as to how to create such an If statement.
Can anyone help? I'm guessing it's some sort of string function but I
haven't tried any yet. Was hoping for some advice first before I really
mess things up. Thanks for any help you can provide.