@eli-k made an important point if you want to take string variables into account.
In case you have a dataset with a lot of variables and you want to save yourself typing a long list of variable names, you can dynamicly generate a list of numeric variables and one of string variables with help of the Python Plugin (which must be installed).
The following code creates the two macros "!numericvars" and "!stringvars". When called they will be expanded to the according variable list.
BEGIN PROGRAM.
import spss
#create separate strings of numeric and string variables
numericvars=''
stringvars=''
varcount=spss.GetVariableCount()
for i in xrange(varcount):
if spss.GetVariableType(i) > 0:
stringvars=stringvars + " " + spss.GetVariableName(i)
else:
numericvars=numericvars + " " + spss.GetVariableName(i)
# define macro variables for the numeric and the string variable lists
spss.SetMacroValue("!numericvars", numericvars)
spss.SetMacroValue("!stringvars", stringvars)
END PROGRAM.
(I've taken most of the code from the example of spss.SetMacroValue syntax reference page)
Within the COUNT
command you then just have to type the macro names instead of the whole variables lists.
COUNT countmiss = !numericvars (MISSING)
!stringvars ("").
Then you can make use of the SELECT IF
command as proposed by @eli-k.
SELECT IF countmiss < 20./* pick your best suited limit instead of "20".
This will delete all cases with 20 or more missing answers permanently from your data set.
Or you can use the FILTER BY
command as proposed by @maxwelldeux:
COMPUTE filter_$ = (countmiss<20).
FILTER BY filter_$.
In this case data from the respondents with 20 or more missing answers won't be used in program procedures as long as the filter is active, while the data still remains in the data set.