libname hercules 's:\courses\stat-renaes\stat404'; * this cleaning is shown in several steps with the last DATA step being the all-in-one clean; title 'Uncleaned data'; proc print data=hercules.nonsales; run; title; * this cancels the previous title (as long as it is not a numbered title); data work.clean; set hercules.nonsales; Country=upcase(Country); run; title 'Cleaned Countries'; proc print data=work.clean; var Employee_ID Job_Title Country; run; title; data work.clean; set hercules.nonsales; Country=upcase(Country); if Employee_ID=120106 then Salary=26960; if Employee_ID=120115 then Salary=26500; if Employee_ID=120191 then Salary=24015; run; title "Cleaned Salaries 1"; proc print data=work.clean; var Employee_ID Salary Job_Title Country; run; title; data work.clean; set hercules.nonsales; if Employee_ID=120106 then Salary=26960; else if Employee_ID=120115 then Salary=26500; else if Employee_ID=120191 then Salary=24015; run; title 'Cleaned Countries and Salaries 2'; proc print data=work.clean; var Employee_ID Salary Job_Title Country; run; title; *multiple steps; data work.clean; set hercules.nonsales; Country=upcase(Country); if Employee_ID=120106 then Salary=26960; else if Employee_ID=120115 then Salary=26500; else if Employee_ID=120191 then Salary=24015; else if Employee_ID=120107 then Hire_Date='21JAN1995'd; else if Employee_ID=120111 then Hire_Date='01NOV1978'd; else if Employee_ID=121011 then Hire_Date='01JAN1998'd; run; title 'Cleaned Countries, salaries and dates'; proc print data=work.clean; var Employee_ID Salary Job_Title Country Hire_Date; run; title;