filename in1 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract01.pos'; filename in2 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract02.pos'; filename in3 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract03.pos'; filename in4 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract04.pos'; filename in5 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract05.pos'; filename in6 '/u/quetelet/m3/ftp/pub/data/nels/jan/xtract06.pos'; options nocenter compress=yes; /* for JDL 1-28-96 */ data extract1; infile in1; /* read in first file */ input id 1-7 school 8-12; proc sort; /* sort by school */ by school; data test2; set extract1; /* re-read sorted file */ by school; if first.school; /* keep one observation per school */ data test3; set test2; num=_N_; /* number the schools from 1 to N */ data test4; merge extract1 test3; /* add the numbering to the first file */ by school; proc sort; /* resort by student id */ by id; data extract2; /* read in the second through sixth file */ infile in2; input id 1-7 read1 8 math1 9 science1 10 hist1 11; data extract3; infile in3; input id 1-7 race 8 ses 9 read2 10 math2 11 science2 12 hist2 13 sex 14; data extract4; infile in4; input id 1-7 type 8 totenrl 9-10 urban 11 region 12 minority 13-15 stuteach 16-17; data extract5; infile in5; input id 1-7 read3 8 math3 9 science3 10 hist3 11; data extract6; infile in6; input id 1-7 pared 8-9; data final; /* bring it all together */ merge test4(in=x) extract2 extract3 extract4 extract5 extract6; by id; if x; /* keep if valid student id and school */ data _null_; /* produce an ascii file */ set final; file '~vlew/jannel.asc'; put (num) (1 *5., +1) (read1 math1 science1 hist1 race ses read2 math2 science2 hist2 sex type totenrl urban region) (15 *3., +1) (minority) (1 *5., +1) (stuteach read3 math3 science3 hist3 pared) (6 *3., +1) +1 id 7.; run;