* To save a file having kn cases into k files of n cases each. * Answer by rlevesque@videotron.ca. *Generate a file of 200 cases for illustration purposes. NEW file. input program. SET SEED=246813579. loop caseid=1 to 200. leave caseid. compute age=RND(uniform(100)). COMPUTE gender=UNIFORM(1)>.5. FORMATS caseid TO gender (F8.0). end case. end loop. end file. end input program. execute. SET MPRINT=ON. *Define a macro which will do the job. DEFINE !save_it (file=!TOKENS(1) /size=!TOKENS(1)) DO IF $casenum=1. COMPUTE number1=1. COMPUTE file_nb=1. ELSE IF lag(number1)