10-07-2016 02:18 PM
There can be differences between what a variable contains, vs. how it displays. To prepare, you will need to run a PROC CONTENTS on your data set and note the characteristics of the variable that holds the dates ... is it numeric or character, what is its length, does it have a format.
10-08-2016 08:35 PM
Assuming your date column is numeric with a date format this is straightforward. Below is an example of deleting all rows from a copy of SASHELP.AIR where the year is earlier than 1955. You should simply follow the same method for your problem.
data air; set sashelp.air; run; proc sql; delete from air where year(date) < 1955; quit;
10-09-2016 01:34 PM
Also, the DATA step supports a WHERE statement, so technically, you did not need the PROC SQL step at all.
proc freq data=sashelp.air; title '1 Before: Years in SASHELP.AIR'; tables date; format date year4.; run; ** subset only rows GE 1955 for year(date); data air; set sashelp.air; where year(date) GE 1955; run; proc freq data=air; title '2 After: only years GE 1955'; tables date; format date year4.; run;