Hi,
I need to populate a macro variable, filedate, with the following saturdays date. It needs to be formatted as yyyymmdd.
The following code is how far I've got.
The &filedate. variable doesn't work correctly when run using %put. I get todays date and part of the code, eg 20100223+(7-2).
I created the macro variable, &fdate., to deal with this. This still doesn't show the correct date.
When I create a new field in a data step the process works. At which point I would need to populate my original variable, %filedate.
Any ideas on how to deal with this?
Is it a symput/symget situation?
The code is as follows:
%let filedate=%sysfunc(date(),yymmddn8.)+(7-%sysfunc(weekday(%sysfunc(date()))));
%let fdate = %substr(&filedate.,1,8);
%put &filedate.;
%put &fdate.;
data work.test;
filedate=&filedate.;
fdate=&fdate.;
run;
Thanks for any help that can be provided
tubbsy123