/* 03b - Conditional Observations */
libname y "y:\sas\data";
data subset7;
set y.employees;
if gender = "f";
run;
proc means; var salary; run;
data subset8;
set y.employees;
if gender = "f" then output;
run;
proc means; var salary; run;
data women men;
set y.employees;
if gender = "f" then output women;
if gender = "m" then output men;
run;
/*Question: which data set does proc means use? */
proc means; var salary; run;
data subset9;
set y.employees;
where gender eq "f";
run;
proc means; var salary; run;
data subset10;
set y.employees(where=(gender eq "m"));
run;
proc means; var salary; run;
data subset10; /* Not possible with WHERE */
set y.employees;
if salary - salbegin > 15000;
run;
proc means data=y.employees(where=(gender eq "m"));
var salary;
run;
proc means data=y.employees;
where gender eq "m"; /* as a statement */
var salary;
run;