Generate a report for a 15-day period starting exactly 1,000 days before today. The report title should include the start date (Day 1) and end date (Day 15) of this period.
Expected output:
Show what you have already tried and where your problems are. Note: SAS date values are counts of days, so the 1000-day and 15-day intervals are simple to build.
Once you get these start and end date like the following, that would be very easy thing.
data start_end;
do start=date()-1000 to date() by 15;
end=start+14;
output;
end;
format start end date9.;
run;
@rahulpatil6886 Please go back to your original post and modify the subject line to briefly describe the problem. When you use a subject line like "Problem 1", no one knows if this is a problem they will be interested in or not.
Not sure if you're asking about how to generate the title, or the WHERE statement for filtering your data. Can you show an example of the code you have tried?
I would likely use the macro variables to store the start and end of the interval. You could calculate those like:
%let start= %sysfunc(intnx(day,%sysfunc(today()),-1000),date9) ;
%let end= %sysfunc(intnx(day,%sysfunc(today()),-1000+15),date9) ;
%put &=start &=end ;
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.