* Make dummy data file for illustration purposes. NEW file. INPUT PROGRAM. SET SEED=987654321. LOOP ID=1 to 100. COMPUTE grade=6+trunc(uniform(7)). END CASE. end loop. end file. end input program. execute. SET MPRINT=on. *////////////////////////////////. DEFINE corpsum (grades=!CMDEND) COMPUTE filt=0. !do !n !in (!grades) !if (!n !ne '0') !then if (grade=!n) filt=1 . !else execute . filter by filt . LIST. * Enter here any processing you want to do. recode filt (else=0) . execute . !ifend !doend . execute . filter by filt . LIST. recode filt (else=0) . execute . !ENDDEFINE. *////////////////////////////////. * Following macro call runs analysis in cases where grades=6. * Then on cases where grades=7 or 8. * Then on cases where grades=9 or 10. * etc. corpsum grades=6 0 7 8 0 9 10 0 11 12.