Date: Mon, 29 Sep 2008 17:43:26 -0400
Reply-To: Gary Stevens <garystevens@FLHSA.ORG>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Gary Stevens <garystevens@FLHSA.ORG>
Subject: widcards
How do I denote a wildcard in a five character wide field?
As an example, if * were a wildcard and I wrote 250** I would expect to
select all data with 250 in the first three positions and anything else in
the next two positions.
Here's what I really want to do. I have 15 variables, xx1 to xx15, side by
side. I want to find if 254** or 2344* or 3366* is found in any of variable
columns 1-15.
A record line might have more than one scattered along the 15 columns or
just one found in V15. I just want to know if it occurs in that record.
I will crosstab the findings.
Here's my attempt:
The syntax below only finds the exact data i.e. '254' and not '254**'
vector v1=xx1 to xx15.
loop #i=1 to 15.
do if (any(v1(#i),'2344 ','254 ','3366 ')).
compute positive=1.
break.
end if.
end loop.
Many thanks,
Gary
=====================
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