I'm a newbie in SAS. I would need help from the SAS community to optimize a SAS code I'm working on.
The current code is as follows:
%macro sales (outdata, date)
[
Create Table
Select data
%mend sales
]
/* The current code invokes macro manually as */
%Sales (Outdata = Sales_Aug, date = '2017-08-01');
%Sales (Outdata = Sales_Sept, date = '2017-09-01');
%Sales (Outdata = Sales_Oct, date = '2017-10-01');
/* So every month I've to manually enter last 3 months as input to the macro */
Is there a way, I can make the macro call dynamic? So that If I run the code in November, it selects data from last 3 months (Aug, Sept, Oct) and If I run the code in December, it gives data from Sept, Oct, Nov?