* (Q) How can I automatically delete all variables where all values are 0? * (A) Posted to SPSSX-L list by Raynald Levesque on 2004/01/09. * paste the list of variables in the next macro definition then run the syntax. define !varlist()v1 v2 v3!enddefine. data list list / v1 v2 v3. begin data 0 0 1 1 0 1 0 0 0 0 0 0 end data. save outfile='c:\\temp\\data.sav'. compute nobreak=1. aggregate outfile='c:\\temp\\file1.sav' /pre /break=nobreak /!varlist=MAX(!varlist). aggregate outfile=* /pre /break=nobreak /!varlist=MIN(!varlist). add files file=* /file='c:\\temp\\file1.sav'. execute. aggregate outfile=* /pre /break=nobreak /!varlist=SUM(!varlist). flip. select if var001=0. do if $casenum=1. - write outfile='c:\\temp\\delete var.sps' /'add files file=* /drop='case_lbl. else. - write outfile='c:\\temp\\delete var.sps' /' 'case_lbl. end if. execute. get file='c:\\temp\\data.sav'. include 'c:\\temp\\delete var.sps' . execute.