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