Hi I am new to SPSS and I am looking for a syntax to delete variables than have width more than 500.
I want to delete all string variables themselves that are more than 500 characters. So far I have only managed to find the syntax to delete all string variables and variables that begin with BP.
begin program.
import spss, spssaux
dict2=spssaux.VariableDict(pattern='^BP')
dict1=spssaux.VariableDict(variableType='string')
vars1 = " ".join(dict1.variables)
vars2 = " ".join(dict2.variables)
dropvars=vars1+ " " +vars2
spss.Submit("Delete Variable " + dropvars)
end program.
Please let me know how I can perhaps modify this to include the condition that the string variables that have to be deleted have width more than 500.


雷达卡



京公网安备 11010802022788号







