options pagesize=58; options linesize=78; libname in2 "../"; libname in1 "."; title1 "Stanne teachers in their subgroups"; data one; infile "stanne.place"; input cnumber chooser group; if group=10 then cgroup='J/10'; if group=1 then cgroup='A/1'; if group=2 then cgroup='B/2'; if group=3 then cgroup='C/3'; if group=4 then cgroup='D/4'; if group=5 then cgroup='E/5'; if group=6 then cgroup='F/6'; if group=7 then cgroup='G/7'; if group=8 then cgroup='H/8'; if group=9 then cgroup='I/9'; if group=11 then cgroup='K/11'; if group=12 then cgroup='L/12'; if group=13 then cgroup='M/13'; if group=14 then cgroup='N/14'; if group=15 then cgroup='O/15'; if group=16 then cgroup='P/16'; if group=17 then cgroup='Q/17'; if group=18 then cgroup='R/18'; if group=19 then cgroup='S/19'; if group=20 then cgroup='T/20'; if group=21 then cgroup='U/21'; if group=22 then cgroup='V/22'; if group=23 then cgroup='W/23'; if group=24 then cgroup='X/24'; if group=25 then cgroup='Y/25'; if group=26 then cgroup='Z/26'; if group=27 then cgroup='a/27'; if group=28 then cgroup='b/28'; if group=29 then cgroup='c/29'; if group=30 then cgroup='d/30'; if group=31 then cgroup='e/31'; if group=32 then cgroup='f/32'; if group=33 then cgroup='g/33'; if group=34 then cgroup='h/34'; oldid=chooser; xgroup=cgroup; drop cgroup; proc sort; by oldid; data withr; set in1.backg3; rmagent=magent; proc rank out=withr2; var rmagent; data two; merge withr2 one; by oldid; if xgroup ne ""; rmagent=25-rmagent; proc sort; by xgroup oldid; *proc print; *by cgroup; *var chooser name cparty prestige d42 father dpartcl zip2 dparibas dcenter dmasons dena digf afec dbank dgecole dpolytch dparis dcabinet tresor; proc print noobs label uniform; by xgroup; var oldid yrsschl genderc room afield1 magent rmagent; endsas; proc print noobs label uniform; by cgroup; var chooser name cparty prestige d42 father dpartcl zip2 dparibas dcenter dmasons dena digf afec dbank dgecole dpolytch dparis dcabinet tresor; run;