proc sql outobs=20; title 'All March Flights'; select m.date, m.flightnumber label='Flight Number', m.destination label='Left', f.destination label='Right', delay label='Delay in Minutes' from sasuser.marchflights as m left join sasuser.flightdelays as f on m.date=f.date and m.flightnumber= f.flightnumber order by delay; quit;
proc sql; select empid from sasuser.supervisors as m, (select substr(jobcode,1,2) as JobCategory, state from sasuser.staffmaster as s, sasuser.payrollmaster as p where s.empid=p.empid and s.empid in (select empid from sasuser.flightschedule where date='04mar2000'd and destination='CPH')) as c where m.jobcategory=c.jobcategory and m.state=c.state; quit;