DATA Step, Macro, Functions and more

how to run data for past N days

Reply
Contributor
Posts: 29

how to run data for past N days

Hi,

 

Could anyone help me with this issue?  Now I have the coding to run the data based on previous day, what I have is as below:

 

%let APPCATIONDATE = %eval(%sysfunc(today())-1);

 

How to change it to past N days, for example I want the past 3 days data or 5 days data?

 

Thank you very much.

Super User
Super User
Posts: 9,866

Re: how to run data for past N days

Posted in reply to septemberbulb
%let numdays=3;

data dataforlastdays;
  set maindata;
  where applicationdate >= today() - &numdays.;
run;
Ask a Question
Discussion stats
  • 1 reply
  • 82 views
  • 0 likes
  • 2 in conversation