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 (April 2000)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 Apr 2000 11:21:58 +0200
Reply-To:   Nico van Ruyven <vruyven@PSY.UVA.NL>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Nico van Ruyven <vruyven@PSY.UVA.NL>
Organization:   Universiteit van Amsterdam
Subject:   Re: Searching, wild card?
Comments:   To: Vivian Calderon <Vivian.Calderon@UCOP.EDU>
Content-Type:   text/plain; charset=us-ascii

Vivian, you can use the stringfunction INDEX, which searches for a string in another string; if found the function returns the position of the occurence of the first matching character, if not found (and in your case, the solution) it returns 0 (zero). An example:

COMPUTE english = INDEX(UPCASE(course),"ENGL").

The new variable english is zero, if course has not the frase "ENGL" in it and more than zero if it has. I added the function UPCASE (put all letters in uppercase); now it works also, if course is *Engl* or *engl*.

Nico van Ruyven Fac. of Psychology University of Amsterdam

Vivian Calderon wrote: > > Is there syntax that would allow me to search characters within a field? > I've got almost 200,000 enrollment records (from 1 to 60 records per ID, > multiple records) and I want to cut out the English courses. > > Since the records originate from different colleges, the course title > layouts vary, but somewhere in the 12 character string variable "course" is > the description "ENGL". > > I guess I'm asking if I can use a wild card to search for ENGL*, *ENGL, OR > *ENGL*. > > Thanks in advance, > Vivian > > Vivian Calderon, Ph.D. > Manager, Research and Assessment > Puente Project > University of California > Office of the President > 1-510-987-9037 > ..............................


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