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