Using SPSSINC Select Variables

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

Using SPSSINC Select Variables

Brian Dates
Hi, all.

I'm sure there's an easy answer to this question. I have a large database and want to select a subset of variables. When I use the extension command Select Variables, I get a list of selected variables and the macro that produced the list, but not the data contained in the variable. My question is how do I use the outcome aside from copying the variable names and including in a /Keep= statement with Save/Outfile? Thanks.

Brian
Reply | Threaded
Open this post in threaded view
|

Re: Using SPSSINC Select Variables

jkpeck
SPSSINC SELECT VARIABLES creates a macro containing the variable names matched by the selection expression with a blank or other separator character such as a "+" forCTABLES.

You would then use that macro in any syntax that takes a variable list just as if you had typed in the names directly.  For example, if you wanted to delete all the variables that were not selected you could do this, assuming the generated macro was named !brian.
ADD FILES FILE=* /KEEP=!brian.
Reply | Threaded
Open this post in threaded view
|

Re: Using SPSSINC Select Variables

Brian Dates
Jon,

Thanks. I had the first part but wasn't sure about just what we can do. It's a great extension!

Brian
Reply | Threaded
Open this post in threaded view
|

Re: Using SPSSINC Select Variables

jkpeck
It's one of my favorite extension commands