Hi,
I need to create a table that will update with the dates for the next 15 days, as an example...
DAY DATE
D_1 30Jun2012:00:00:00
D_2 01Jul2012:00:00:00
D_3 02Jul2012:00:00:00
D_4 03Jul2012:00:00:00
...
Here is the macro that creates a date, but I need to know how to put it in a table
%let today = %sysfunc(today());
%let D_1 = %sysfunc(dhms(%sysfunc(intnx(day,&today,1)),7,0,0),DATETIME20.);
%let D_2 = %sysfunc(dhms(%sysfunc(intnx(day,&today,2)),7,0,0),DATETIME20.);
%let D_3 = %sysfunc(dhms(%sysfunc(intnx(day,&today,3)),7,0,0),DATETIME20.);
%let D_4 = %sysfunc(dhms(%sysfunc(intnx(day,&today,4)),7,0,0),DATETIME20.);
Thanks in advance
Why don't you just use a data step like below?
data mydates;
format date date9. datetime07 datetime21.;
do date=today() to today()+14;
datetime07=dhms(date,7,0,0);
output;
end;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.