Date: Thu, 20 Dec 2007 21:26:32 -0700
Reply-To: ViAnn Beadle <vab88011@gmail.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: ViAnn Beadle <vab88011@gmail.com>
Subject: Re: Wildcard
In-Reply-To: <476A9394.BA70.00C4.0@co.doc.state.mn.us>
Content-Type: text/plain; charset="us-ascii"
Putting aside for the moment the things that you can do with Python, there
is no notion of a wild card in SPSS transformations per se. Note however,
you can select cases using the INDEX function which finds the first
occurrence of the string. Here's a simple example:
COMPUTE var609=INDEX(stringvar, '609.').
FILTER by var609.
The FILTER command selects all cases for which the BY variable equals 1 or
greater. If "609" can occur somewhere else in the string and you only want
values starting at 1, then you'll have to take an extra step here and recode
your filter variable to take on values 1 and 0, as in
RECODE var609 (1=1) (else=0).
Python provides much more powerful pattern matching but that isn't required
for this example.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Jo
Gulstad
Sent: Thursday, December 20, 2007 3:09 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Wildcard
Hello all,
Is there a "wildcard" option when selecting cases, such as "609.*" as in
Access? That is, all statutes 609.xxxx will be selected?
Thank you!
Jo Gulstad
Research Analyst
Minnesota Department of Corrections
1450 Energy Park Drive, Suite 200
St Paul, MN 55108
651.361.7383
=======
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
=====================
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