Date: Fri, 2 Dec 2011 12:32:59 -0800
Reply-To: David Marso <david.marso@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: David Marso <david.marso@gmail.com>
Subject: Re: Advice for Simplifying Two-line Syntax?
In-Reply-To: <000301ccb13b$51f48d30$f5dda790$@gmail.com>
Content-Type: text/plain; charset=us-ascii
Build 2 additional files A.sav, B.sav
A.sav: sorted by KEY VARIABLES [location and OldProductTitle: with data
field: NewProductTitle],
B.sav: sorted by KEY VARIABLES [location and NewProductTitle: with data
field: ProductNo].
CODE:
--
GET FILE "your master file.sav".
SORT CASES BY location OldProductTitle.
MATCH FILES / FILE * /TABLE "A.sav" / BY location OldProductTitle.
SORT CASES BY location NewProductTitle.
MATCH FILES / FILE * /TABLE "B.sav" / BY location NewProductTitle.
FREQ NewProductTitle.
*MUCH EASIER than maintaining a 800 line syntax file!!!*
FWIW: You *CAN NOT* condense your 2 liner into a one liner as it presumes
computing 2 new variables.
OTOH: Using the 2 tables will result in a low overhead aside from keeping
your tables up to date.
These would best be stored in some sort of central data base!
HTH, David
--
elle lists wrote
>
> I'm correcting product names and plugging-in product numbers in a data set
> by using the IF statement and two conditions based on "Location" and
> "OldProductTitle". (Location is used to verify the product title as
> variations occur throughout the data set because the info has been entered
> inconsistently.) The two-line syntax works (shown below) but is there a
> way
> to condense the two or achieve the same effect in more efficient manner as
> the corrections number over 400 (which means 800 syntax lines)? I'd also
> like to maintain working with strings as this situation is likely to
> reoccur. Many thanks for your advice. ~elle
>
>
>
> SYNTAX EXAMPLE
>
>
>
> IF Location='Riverside' AND OldProductTitle='McAfee 2012'
> NewProductTitle='McAfee Total Protection 2012-3 Users'.
>
> IF Location='Riverside' AND NewProductTitle='McAfee Total Protection
> 2012-3
> Users' ProductNo='B005AAWYR2'.
>
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Advice-for-Simplifying-Two-line-Syntax-tp5043095p5043158.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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