0
votes

If a date variable is greater than 2/10/2014 by 7 days, then I would like to output the row to a new table. Anything under 7 days, do not output. How would go about doing this in SAS?

1

1 Answers

1
votes

This is easy in a data step

data before after;
set input;

if date - "10FEB2014"d > 7 then
   output after;
else
   output before;
run;

Dates are numeric variables represented as the number of days from an epoc (1/1/1960 I believe). So simple adding and subtracting works well.