Selecting Cases with Text in a String Variable

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Selecting Cases with Text in a String Variable

Jim Moffitt
I have a data set containing a string variable named q62.
 
I'd like to temporarily select only those cases that have text entries
in q62 (I do not want to delete the cases that have blanks in q62).
 
How would I write a syntax command to temporarily select only those
cases that have text entries in q62?
 
TIA
Reply | Threaded
Open this post in threaded view
|

Re: Selecting Cases with Text in a String Variable

Edward Boadi
Hi James ,

Try this :

GET FILE = "DataFile.sav" .
COMPUTE filter_$=(q62 <> "").
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .

Regards.
Edward.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Jim Moffitt
Sent: Wednesday, November 01, 2006 4:32 PM
To: [hidden email]
Subject: Selecting Cases with Text in a String Variable


I have a data set containing a string variable named q62.

I'd like to temporarily select only those cases that have text entries
in q62 (I do not want to delete the cases that have blanks in q62).

How would I write a syntax command to temporarily select only those
cases that have text entries in q62?

TIA
Reply | Threaded
Open this post in threaded view
|

Re: Selecting Cases with Text in a String Variable

Jim Moffitt
In reply to this post by Jim Moffitt
Fabulous, Edward! Thank you very much.

-----Original Message-----
From: Edward Boadi [mailto:[hidden email]]
Sent: Wednesday, November 01, 2006 3:45 PM
To: Moffitt, James (West); [hidden email]
Subject: RE: Selecting Cases with Text in a String Variable

Hi James ,

Try this :

GET FILE = "DataFile.sav" .
COMPUTE filter_$=(q62 <> "").
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .

Regards.
Edward.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Jim Moffitt
Sent: Wednesday, November 01, 2006 4:32 PM
To: [hidden email]
Subject: Selecting Cases with Text in a String Variable


I have a data set containing a string variable named q62.

I'd like to temporarily select only those cases that have text entries
in q62 (I do not want to delete the cases that have blanks in q62).

How would I write a syntax command to temporarily select only those
cases that have text entries in q62?

TIA