libname hercules 's:\courses\stat-renaes\stat404'; proc print data=hercules.nonsales; run; proc print data=hercules.nonsales; var Employee_ID Gender Salary Job_Title Country Birth_Date Hire_Date; where Employee_ID = . or Gender not in ('F','M') or Salary not between 24000 and 500000 or Job_Title = ' ' or Country not in ('AU','US') or Birth_Date > Hire_Date or Hire_Date < '01JAN1974'd; run; * you could also use a DATA step to create a new dataset that meets the conditions set in the WHERE statement of PROC PRINT (the first methods requires 2 less lines of code -- but same results. Although you may not want to create a dataset for validation.; data work.emps; set hercules.nonsales; var Employee_ID Gender Salary Job_Title Country Birth_Date Hire_Date; where Employee_ID = . or Gender not in ('F','M') or Salary not between 24000 and 500000 or Job_Title = ' ' or Country not in ('AU','US') or Birth_Date > Hire_Date or Hire_Date < '01JAN1974'd; run; proc print data=emps; run; proc means data=hercules.nonsales; var Salary; run; proc means data=hercules.nonsales n nmiss min max; var Salary; run; proc univariate data=hercules.nonsales; var Salary; run; proc freq data=hercules.nonsales; tables Gender Country; run; proc freq data=hercules.nonsales; tables Employee_ID; run; proc freq data=hercules.nonsales nlevels; tables Gender Country Employee_ID; run; proc freq data=hercules.nonsales nlevels; tables Gender Country Employee_ID / noprint; run; proc freq data=hercules.nonsales nlevels; tables _all_ / noprint; run;