LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: John Hill <John.Hill@columbian.com>
In-Reply-To:  <sd107b8d.060@172.16.1.40>
Content-Type: text/plain; charset="US-ASCII"

Hi John,

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). BEGIN DATA ford f1pu Ford F2Pu FORD f2PU FOrd pu fORd PU END DATA. LIST.

* 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'. LIST. --

Mark V. Casazza Director of Academic Information The City University of New York 555 W. 57th St. Suite 1240 New York, NY 10019

phone: 212.541.0396 fax: 212.541.0392 email: Mark.Casazza@mail.cuny.edu

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of John Hill Sent: Wednesday, June 19, 2002 3:39 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: question

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 analysis purposes.

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 pickup.

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.

John Hill 800-743-3391 john.hill@columbian.com


Back to: Top of message | Previous page | Main SPSSX-L page