I run many batch jobs for various time periods. Here is a typical data step to create two macro variables for the start and end of the previous week; data date_parms; analysis_date=today(); date1=intnx('week',analysis_date,-1); date2=intnx('week',analysis_date,-1,'end); call symputx('start_date',date1); call symputx('end_date',date2); format analysis_date, date1 date2 date7.;) run; &start_date and &end_date are macro variables for the start and end of the previous week. If you need to rerun the program for a prior week you just need to change the analysis_date to a prior week.
... View more